Search Linux Wireless

Re: [PATCH 05/15] mac80211: remove HW_KEY_IDX_INVALID

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

 



On Friday 24 August 2007 19:14:06 Larry Finger wrote:
> Johannes Berg wrote:
> 
> The following hunk in wireless-dev/include/net/mac80211.h
> 
> @@ -200,13 +199,13 @@ struct ieee80211_tx_control {
>   						  * long retry value */
>   	u32 flags;			       /* tx control flags defined
>   						* above */
> +	u8 key_idx;		/* keyidx from hw->set_key(), undefined if
> +				 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
>   	u8 retry_limit;		/* 1 = only first attempt, 2 = one retry, ..
>   				 * This could be used when set_retry_limit
>   				 * is not implemented by the driver */
>   	u8 power_level;		/* per-packet transmit power level, in dBm */
>   	u8 antenna_sel_tx; 	/* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
> -	s8 key_idx;		/* HW_KEY_IDX_INVALID = do not encrypt,
> -				 * other values: keyidx from hw->set_key() */
>   	u8 icv_len;		/* length of the ICV/MIC field in octets */
>   	u8 iv_len;		/* length of the IV field in octets */
>   	u8 tkip_key[16];	/* generated phase2/phase1 key for hw TKIP */
> 
> leads to a compiler warning "warning: comparison is always true due to limited range of data type" 
> for b43 and b43legacy on the fiollowing statement.
> 
>          int use_encryption = ((!(txctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT))
>                                && (txctl->key_idx >= 0));
> 
> What did a negative key_idx mean before? How is that condition represented now, or is it safe to 
> drop the entire portion following the &&?

Simply drop the test for key_idx>=0.
It doesn't make sense to have two conditions in the tx control
to indicate use of encryption, so the negative key index was
removed and the DO_NOT_ENCRYPT flag is the one to test.
So you should probably remove the use_encryption variable, too,
and test the txctl->flags in the place where it's needed.

-- 
Greetings Michael.
-
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