Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@adurom.com>
To: Senthil Balasubramanian <senthilkumar@atheros.com>
Cc: "gregkh\@suse.de" <gregkh@suse.de>,
	"devel\@linuxdriverproject.org" <devel@linuxdriverproject.org>,
	"linux-wireless\@vger.kernel.org"
	<linux-wireless@vger.kernel.org>,
	Naveen Singh <Naveen.Singh@Atheros.com>
Subject: Re: [PATCH 1/2] ath6kl: iw dev wlan0 link implementation
Date: Wed, 11 May 2011 01:32:20 +0300	[thread overview]
Message-ID: <87liyefaq3.fsf@purkki.adurom.net> (raw)
In-Reply-To: <20110510120243.GA2017@senthil-lnx.users.atheros.com> (Senthil Balasubramanian's message of "Tue\, 10 May 2011 17\:32\:43 +0530")

Senthil Balasubramanian <senthilkumar@atheros.com> writes:

> On Tue, May 10, 2011 at 10:10:23AM +0530, Kalle Valo wrote:
>> From: Naveen Singh <nsingh@atheros.com>
>> 
>> implementing the cfg ops that gets called when iw dev wlan0
>> link is issued by user. The ops that needs to be implemented
>> is get_station.
>> 
>> kvalo: check the mac address and fix style issues

[...]

>> +int ar6k_get_station(struct wiphy *wiphy, struct net_device *dev,
>> +		     u8 *mac, struct station_info *sinfo)
>> +{
>> +	struct ar6_softc *ar = ar6k_priv(dev);
>> +	u8 mcs, ret, timeout = false;
>> +
>> +	if (compare_ether_addr(mac, ar->arBssid))
>
> this may result in unaligned memeory access on some platforms as mac
> may not be 2 byte aligned. This is the case with the caller as per
> cfg80211_wext_giwrate() and cfg80211_wireless_stats().

I didn't think of this. I'll change it to use memcmp() instead.

>> +	wait_event_interruptible_timeout(arEvent,
>> +					 ar->statsUpdatePending == false,
>> +					 wmitimeout * HZ);
>> +
>> +	if (signal_pending(current)) {
>
> wait_event_interruptible_tiemout() itself checks for signal_pending
> and so this is not necessary. You can check for the return status of
> wait_event_interruptible_timeout() to know whether the task was
> interrupted by a signal.

Will fix.

>> +		timeout = true;
>> +		AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
>> +				("ar6000 : WMI get stats timeout\n"));
>> +	}
>> +
>> +	up(&ar->arSem);
>
> I believe we can release the semaphore early on. I don't see any reason..

What do you mean? I'm not the author of the patch, but I assume that
the idea is to protect the access to ar->statsUpdatePending.

Thanks for the review, I'll submit v2.

-- 
Kalle Valo

      reply	other threads:[~2011-05-10 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10  4:40 [PATCH 1/2] ath6kl: iw dev wlan0 link implementation Kalle Valo
2011-05-10  4:40 ` [PATCH 2/2] ath6kl: provide hardware version to userspace Kalle Valo
2011-05-10 12:02 ` [PATCH 1/2] ath6kl: iw dev wlan0 link implementation Senthil Balasubramanian
2011-05-10 22:32   ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87liyefaq3.fsf@purkki.adurom.net \
    --to=kvalo@adurom.com \
    --cc=Naveen.Singh@Atheros.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=senthilkumar@atheros.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox