Search Linux Wireless

Re: [PATCH 4/4] ath5k: Use SWI to trigger calibration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/01/2009 07:46 AM, Nick Kossifidis wrote:
> --- a/drivers/net/wireless/ath/ath5k/phy.c
> +++ b/drivers/net/wireless/ath/ath5k/phy.c
> @@ -1104,6 +1104,26 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
>    PHY calibration
>  \*****************/
>  
> +void
> +ath5k_hw_calibration_poll(struct ath5k_hw *ah)
> +{
> +	u32 current_time = (jiffies / HZ);

jiffies are long. And they start from negative to catch such issues. You
were lucky and/or tested after 5 minutes of uptime ;).

> +	u32 cal_intval = ah->ah_cal_intval;
> +
> +	if (!ah->ah_cal_tstamp)
> +		ah->ah_cal_tstamp = current_time;
> +
> +	/* For now we always do full calibration
> +	 * Mark software interrupt mask and fire software
> +	 * interrupt (bit gets auto-cleared) */
> +	if ((current_time - ah->ah_cal_tstamp) >= cal_intval) {

Aiee, this should be converted to time_after(). You don't count with a
wrap here. (The same as above.)

> +		ah->ah_cal_tstamp = current_time;
> +		ah->ah_swi_mask = AR5K_SWI_FULL_CALIBRATION;
> +		AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI);
> +	}
> +
> +}

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux