Search Linux Wireless

Re: [PATCH] mac80211: clean up set_key callback

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

 



>  static int iwl_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> -                          const u8 *local_addr, const u8 *addr,
> +                          struct ieee80211_vif *vif,
> +                          struct ieee80211_sta *sta,
>                           struct ieee80211_key_conf *key)
>  {
>        struct iwl_priv *priv = hw->priv;
> @@ -3038,6 +3039,9 @@ static int iwl_mac_set_key(struct ieee80
>        int ret = 0;
>        u8 sta_id = IWL_INVALID_STATION;
>        u8 is_default_wep_key = 0;
> +       static const u8 bcast_addr[ETH_ALEN] =
> +               { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, };
> +       static const u8 *addr;

>        IWL_DEBUG_MAC80211("enter\n");
>
> @@ -3046,9 +3050,7 @@ static int iwl_mac_set_key(struct ieee80
>                return -EOPNOTSUPP;
>        }
>
> -       if (is_zero_ether_addr(addr))
> -               /* only support pairwise keys */
> -               return -EOPNOTSUPP;
> +       addr = sta ? sta->addr : bcast_addr;
>

Please use this code instead in both iwlwifi drivers.

+sta_id = sta ? iwl_find_station(priv, sta->addr) :
priv->hw_params.bcast_sta_id;
- sta_id = iwl_find_station(priv, addr);



>        if (sta_id == IWL_INVALID_STATION) {
> --- wireless-testing.orig/drivers/net/wireless/iwlwifi/iwl3945-base.c   2008-12-24 12:03:05.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/iwlwifi/iwl3945-base.c        2008-12-24 12:25:51.000000000 +0100
> @@ -6561,12 +6561,16 @@ out_unlock:
>  }
>
>  static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> -                          const u8 *local_addr, const u8 *addr,
> -                          struct ieee80211_key_conf *key)
> +                              struct ieee80211_vif *vif,
> +                              struct ieee80211_sta *sta,
> +                              struct ieee80211_key_conf *key)
>  {
>        struct iwl_priv *priv = hw->priv;
> +       const u8 *addr;
>        int rc = 0;
>        u8 sta_id;
> +       static const u8 bcast_addr[ETH_ALEN] =
> +               { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
>
>        IWL_DEBUG_MAC80211("enter\n");
>
> @@ -6575,9 +6579,7 @@ static int iwl3945_mac_set_key(struct ie
>                return -EOPNOTSUPP;
>        }
>
> -       if (is_zero_ether_addr(addr))
> -               /* only support pairwise keys */
> -               return -EOPNOTSUPP;
> +       addr = sta ? sta->addr : bcast_addr;
>
>        sta_id = iwl3945_hw_find_station(priv, addr);
>        if (sta_id == IWL_INVALID_STATION) {
> --- wireless-testing.orig/drivers/net/wireless/p54/p54common.c  2008-12-24 12:03:05.000000000 +0100
> +++ wireless-testing/drivers/net/wireless/p54/p54common.c       2008-12-24 12:03:17.000000000 +0100
> @@ -2067,7 +2067,7 @@ static void p54_bss_info_changed(struct
>  }

Thanks
Tomas
--
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