wilc1000: use correct sequence of RESET for chip Power-UP/Down
[email protected]
maintainerPATCH v3 1/4 wilc1000: use correct sequence of RESET for chip Power-UP/Down
From: Ajay Singh <[email protected]>
For power-up sequence, WILC expects RESET set to high 5ms after making chip_en(enable) so corrected chip power-up sequence by making RESET high. For Power-Down sequence, the correct sequence make RESET and CHIP_EN low without any extra delay.
---
v2: No changes
v3: add "Fixes" tag in commit description
drivers/net/wireless/microchip/wilc1000/spi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/microchip/wilc1000/spi.c +3 -3
@@ -191,11 +191,11 @@ static void wilc_wlan_power(struct wilc *wilc, bool on)/* assert ENABLE: */ gpiod_set_value (gpios->enable,1 );mdelay (5 ); -/* deassert RESET: */ -gpiod_set_value (gpios->reset,0 ); - }else {/* assert RESET: */ gpiod_set_value (gpios->reset,1 ); + }else { +/* deassert RESET: */ +gpiod_set_value (gpios->reset,0 );/* deassert ENABLE: */ gpiod_set_value (gpios->enable,0 ); }
Signature · 1 line
2.25.1
[email protected]
maintainerPATCH v3 2/4 wilc1000: remove WEP security support
From: Ajay Singh <[email protected]>
Deprecated WEP security for WILC driver as well as in firmware from 15.6 FW release onwards. After WEP security removal, freeup some codespace which helped to add new features like WPA3 etc.
--- .../wireless/microchip/wilc1000/cfg80211.c | 76 +------------ drivers/net/wireless/microchip/wilc1000/fw.h | 6 -- drivers/net/wireless/microchip/wilc1000/hif.c | 102 ------------------ drivers/net/wireless/microchip/wilc1000/hif.h | 6 -- .../net/wireless/microchip/wilc1000/netdev.h | 10 -- 5 files changed, 2 insertions(+), 198 deletions(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +2 -74
@@ -313,32 +313,9 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, vif->connecting = true; -memset (priv->wep_key,0 ,sizeof (priv->wep_key)); -memset (priv->wep_key_len,0 ,sizeof (priv->wep_key_len)); - cipher_group = sme->crypto.cipher_group;if (cipher_group !=0 ) { -if (cipher_group ==WLAN_CIPHER_SUITE_WEP40 ) { - security =WILC_FW_SEC_WEP ; - - priv->wep_key_len[sme->key_idx] = sme->key_len; -memcpy (priv->wep_key[sme->key_idx], sme->key, - sme->key_len); - -wilc_set_wep_default_keyid (vif, sme->key_idx); -wilc_add_wep_key_bss_sta (vif, sme->key, sme->key_len, - sme->key_idx); - }else if (cipher_group ==WLAN_CIPHER_SUITE_WEP104 ) { - security =WILC_FW_SEC_WEP_EXTENDED ; - - priv->wep_key_len[sme->key_idx] = sme->key_len; -memcpy (priv->wep_key[sme->key_idx], sme->key, - sme->key_len); - -wilc_set_wep_default_keyid (vif, sme->key_idx); -wilc_add_wep_key_bss_sta (vif, sme->key, sme->key_len, - sme->key_idx); - }else if (sme->crypto.wpa_versions &NL80211_WPA_VERSION_2 ) { +if (sme->crypto.wpa_versions &NL80211_WPA_VERSION_2 ) {if (cipher_group ==WLAN_CIPHER_SUITE_TKIP ) security =WILC_FW_SEC_WPA2_TKIP ;else
@@ -373,10 +350,6 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, auth_type =WILC_FW_AUTH_OPEN_SYSTEM ;break ; -case NL80211_AUTHTYPE_SHARED_KEY : - auth_type =WILC_FW_AUTH_SHARED_KEY ; -break ; -default :break ; }
@@ -487,14 +460,6 @@ static int disconnect(struct wiphy *wiphy, struct net_device *dev,return ret; } -static inline void wilc_wfi_cfg_copy_wep_info (struct wilc_priv *priv, -u8 key_index, -struct key_params *params) -{ - priv->wep_key_len[key_index] = params->key_len; -memcpy (priv->wep_key[key_index], params->key, params->key_len); -} -static int wilc_wfi_cfg_allocate_wpa_entry (struct wilc_priv *priv,u8 idx) {if (!priv->wilc_gtk[idx]) {
@@ -552,33 +517,6 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,struct wilc_priv *priv = &vif->priv;switch (params->cipher) { -case WLAN_CIPHER_SUITE_WEP40 : -case WLAN_CIPHER_SUITE_WEP104 : -if (priv->wdev.iftype ==NL80211_IFTYPE_AP ) { -wilc_wfi_cfg_copy_wep_info (priv, key_index, params); - -if (params->cipher ==WLAN_CIPHER_SUITE_WEP40 ) - mode =WILC_FW_SEC_WEP ; -else - mode =WILC_FW_SEC_WEP_EXTENDED ; - - ret =wilc_add_wep_key_bss_ap (vif, params->key, - params->key_len, - key_index, mode, -WILC_FW_AUTH_OPEN_SYSTEM ); -break ; - } -if (memcmp (params->key, priv->wep_key[key_index], - params->key_len)) { -wilc_wfi_cfg_copy_wep_info (priv, key_index, params); - - ret =wilc_add_wep_key_bss_sta (vif, params->key, - params->key_len, - key_index); - } - -break ; -case WLAN_CIPHER_SUITE_TKIP :case WLAN_CIPHER_SUITE_CCMP : if (priv->wdev.iftype == NL80211_IFTYPE_AP ||
@@ -676,13 +614,6 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev, priv->wilc_ptk[key_index] =NULL ; } -if (key_index <=3 && priv->wep_key_len[key_index]) { -memset (priv->wep_key[key_index],0 , - priv->wep_key_len[key_index]); - priv->wep_key_len[key_index] =0 ; -wilc_remove_wep_key (vif, key_index); - } -return 0 ; }
@@ -713,13 +644,10 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,return 0 ; } +/* wiphy_new_nm() will WARNON if not present */ static int set_default_key (struct wiphy *wiphy,struct net_device *netdev,u8 key_index,bool unicast,bool multicast) { -struct wilc_vif *vif =netdev_priv (netdev); - -wilc_set_wep_default_keyid (vif, key_index); -return 0 ; }
drivers/net/wireless/microchip/wilc1000/fw.h +0 -6
@@ -41,12 +41,6 @@ struct wilc_drv_handler {u8 mode; } __packed; -struct wilc_wep_key { -u8 index; -u8 key_len; -u8 key[]; -} __packed; -struct wilc_sta_wpa_ptk {u8 mac_addr[ETH_ALEN ];u8 key_len;
drivers/net/wireless/microchip/wilc1000/hif.c +0 -102
108 lines not on this page · raw message
drivers/net/wireless/microchip/wilc1000/hif.h +0 -6
@@ -151,12 +151,6 @@ struct host_if_drv { };struct wilc_vif ; -int wilc_remove_wep_key (struct wilc_vif *vif,u8 index); -int wilc_set_wep_default_keyid (struct wilc_vif *vif,u8 index); -int wilc_add_wep_key_bss_sta (struct wilc_vif *vif,const u8 *key,u8 len, -u8 index); -int wilc_add_wep_key_bss_ap (struct wilc_vif *vif,const u8 *key,u8 len, -u8 index,u8 mode,enum authtype auth_type);int wilc_add_ptk (struct wilc_vif *vif,const u8 *ptk,u8 ptk_key_len,const u8 *mac_addr,const u8 *rx_mic,const u8 *tx_mic,u8 mode,u8 cipher_mode,u8 index);
drivers/net/wireless/microchip/wilc1000/netdev.h +0 -10
@@ -45,12 +45,6 @@ struct wilc_wfi_key {u32 cipher; }; -struct wilc_wfi_wep_key { -u8 *key; -u8 key_len; -u8 key_idx; -}; -struct sta_info {u8 sta_associated_bss[WILC_MAX_NUM_STA ][ETH_ALEN ]; };
@@ -63,8 +57,6 @@ struct wilc_wfi_p2p_listen_params { };static const u32 wilc_cipher_suites[] = { -WLAN_CIPHER_SUITE_WEP40 , -WLAN_CIPHER_SUITE_WEP104 ,WLAN_CIPHER_SUITE_TKIP ,WLAN_CIPHER_SUITE_CCMP ,WLAN_CIPHER_SUITE_AES_CMAC
@@ -132,8 +124,6 @@ struct wilc_priv {struct net_device *dev;struct host_if_drv *hif_drv;struct wilc_pmkid_attr pmkid_list; -u8 wep_key[4 ][WLAN_KEY_LEN_WEP104 ]; -u8 wep_key_len[4 ];/* The real interface that the monitor is on */ struct net_device *real_ndev;
Signature · 1 line
2.25.1
[email protected]
maintainerPATCH v3 3/4 wilc1000: add WPA3 SAE support
In reply to [email protected]From: Ajay Singh <[email protected]>
Enable SAE authentication for AP and STA mode. In STA mode, allow the driver to pass the auth frames which are received from firmware to userspace application(hostapd) so that SAE authentication is offloaded to userspace.
---
v2: remove unused variable reported by kernel test robot
.../wireless/microchip/wilc1000/cfg80211.c | 62 +++++++++++++++++-- drivers/net/wireless/microchip/wilc1000/fw.h | 9 +++ drivers/net/wireless/microchip/wilc1000/hif.c | 44 ++++++++++++- drivers/net/wireless/microchip/wilc1000/hif.h | 3 + .../net/wireless/microchip/wilc1000/netdev.c | 11 +++- .../net/wireless/microchip/wilc1000/netdev.h | 3 +- .../net/wireless/microchip/wilc1000/wlan.c | 3 +- .../net/wireless/microchip/wilc1000/wlan.h | 2 + .../net/wireless/microchip/wilc1000/wlan_if.h | 10 ++- 9 files changed, 133 insertions(+), 14 deletions(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +57 -5
@@ -20,9 +20,11 @@static const struct ieee80211_txrx_stypes wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES ] = { [NL80211_IFTYPE_STATION ] = { - .tx =0xffff , + .tx =BIT (IEEE80211_STYPE_ACTION >>4 ) | +BIT (IEEE80211_STYPE_AUTH >>4 ), .rx =BIT (IEEE80211_STYPE_ACTION >>4 ) | -BIT (IEEE80211_STYPE_PROBE_REQ >>4 ) +BIT (IEEE80211_STYPE_PROBE_REQ >>4 ) | +BIT (IEEE80211_STYPE_AUTH >>4 ) }, [NL80211_IFTYPE_AP ] = { .tx =0xffff ,
@@ -350,6 +352,16 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, auth_type =WILC_FW_AUTH_OPEN_SYSTEM ;break ; +case NL80211_AUTHTYPE_SAE : + auth_type =WILC_FW_AUTH_SAE ; +if (sme->ssid_len) { +memcpy (vif->auth.ssid.ssid, sme->ssid, sme->ssid_len); + vif->auth.ssid.ssid_len = sme->ssid_len; + } + vif->auth.key_mgmt_suite =cpu_to_be32 (sme->crypto.akm_suites[0 ]); +ether_addr_copy (vif->auth.bssid, sme->bssid); +break ; +default :break ; }
@@ -357,6 +369,10 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,if (sme->crypto.n_akm_suites) {if (sme->crypto.akm_suites[0 ] ==WLAN_AKM_SUITE_8021X ) auth_type =WILC_FW_AUTH_IEEE8021 ; +else if (sme->crypto.akm_suites[0 ] ==WLAN_AKM_SUITE_PSK_SHA256 ) + auth_type =WILC_FW_AUTH_OPEN_SYSTEM_SHA256 ; +else if (sme->crypto.akm_suites[0 ] ==WLAN_AKM_SUITE_8021X_SHA256 ) + auth_type =WILC_FW_AUTH_IEE8021X_SHA256 ; }if (wfi_drv->usr_scan_req.scan_result) {
@@ -905,6 +921,18 @@ static inline void wilc_wfi_cfg_parse_ch_attr(u8 *buf, u32 len, u8 sta_ch) } } +bool wilc_wfi_mgmt_frame_rx (struct wilc_vif *vif,u8 *buff,u32 size) +{ +struct wilc *wl = vif->wilc; +struct wilc_priv *priv = &vif->priv; +int freq, ret; + + freq =ieee80211_channel_to_frequency (wl->op_ch,NL80211_BAND_2GHZ ); + ret =cfg80211_rx_mgmt (&priv->wdev, freq,0 , buff, size,0 ); + +return ret; +} +void wilc_wfi_p2p_rx (struct wilc_vif *vif,u8 *buff,u32 size) {struct wilc *wl = vif->wilc;
@@ -1090,8 +1118,14 @@ static int mgmt_tx(struct wiphy *wiphy, goto out_txq_add_pkt; } -if (!ieee80211_is_public_action ((struct ieee80211_hdr *)buf, len)) +if (!ieee80211_is_public_action ((struct ieee80211_hdr *)buf, len)) { +if (chan) +wilc_set_mac_chnl_num (vif, chan->hw_value); +else +wilc_set_mac_chnl_num (vif, vif->wilc->op_ch); + goto out_set_timeout; + } d = (struct wilc_p2p_pub_act_frame *)(&mgmt->u.action); if (d->oui_type != WLAN_OUI_TYPE_WFA_P2P ||
@@ -1158,6 +1192,7 @@ void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy,struct wilc_vif *vif =netdev_priv (wdev->netdev);u32 presp_bit =BIT (IEEE80211_STYPE_PROBE_REQ >>4 );u32 action_bit =BIT (IEEE80211_STYPE_ACTION >>4 ); +u32 pauth_bit =BIT (IEEE80211_STYPE_AUTH >>4 );if (wl->initialized) {bool prev = vif->mgmt_reg_stypes & presp_bit;
@@ -1171,10 +1206,26 @@ void wilc_update_mgmt_frame_registrations(struct wiphy *wiphy,if (now != prev)wilc_frame_register (vif,IEEE80211_STYPE_ACTION , now); + + prev = vif->mgmt_reg_stypes & pauth_bit; + now = upd->interface_stypes & pauth_bit; +if (now != prev) +wilc_frame_register (vif,IEEE80211_STYPE_AUTH , now); } vif->mgmt_reg_stypes = - upd->interface_stypes & (presp_bit | action_bit); + upd->interface_stypes & (presp_bit | action_bit | pauth_bit); +} + +static int external_auth (struct wiphy *wiphy,struct net_device *dev, +struct cfg80211_external_auth_params *auth) +{ +struct wilc_vif *vif =netdev_priv (dev); + +if (auth->status ==WLAN_STATUS_SUCCESS ) +wilc_set_external_auth_param (vif, auth); + +return 0 ; } static int set_cqm_rssi_config(struct wiphy *wiphy, struct net_device *dev,
@@ -1590,6 +1641,7 @@ static const struct cfg80211_ops wilc_cfg80211_ops = { .change_bss = change_bss, .set_wiphy_params = set_wiphy_params, + .external_auth = external_auth, .set_pmksa = set_pmksa, .del_pmksa = del_pmksa, .flush_pmksa = flush_pmksa,
@@ -1732,7 +1784,7 @@ struct wilc *wilc_create_wiphy(struct device *dev)BIT (NL80211_IFTYPE_P2P_GO ) |BIT (NL80211_IFTYPE_P2P_CLIENT ); wiphy->flags |=WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL ; - + wiphy->features |=NL80211_FEATURE_SAE ;set_wiphy_dev (wiphy, dev); wl->wiphy = wiphy; ret =wiphy_register (wiphy);
drivers/net/wireless/microchip/wilc1000/fw.h +9 -0
@@ -110,4 +110,13 @@ struct wilc_join_bss_param { struct wilc_noa_opp_enable opp_en; }; } __packed; + +struct wilc_external_auth_param { +u8 action; +u8 bssid[ETH_ALEN ]; +u8 ssid[IEEE80211_MAX_SSID_LEN ]; +u8 ssid_len; +__le32 key_mgmt_suites; +__le16 status; +} __packed;#endif
drivers/net/wireless/microchip/wilc1000/hif.c +41 -3
74 lines not on this page · raw message
drivers/net/wireless/microchip/wilc1000/hif.h +3 -0
@@ -47,6 +47,7 @@ enum host_if_state {HOST_IF_WAITING_CONN_RESP =3 ,HOST_IF_CONNECTED =4 ,HOST_IF_P2P_LISTEN =5 , +HOST_IF_EXTERNAL_AUTH =6 , HOST_IF_FORCE_32BIT = 0xFFFFFFFF };
@@ -202,6 +203,8 @@ int wilc_get_vif_idx(struct wilc_vif *vif);int wilc_set_tx_power (struct wilc_vif *vif,u8 tx_power);int wilc_get_tx_power (struct wilc_vif *vif,u8 *tx_power);void wilc_set_wowlan_trigger (struct wilc_vif *vif,bool enabled); +int wilc_set_external_auth_param (struct wilc_vif *vif, +struct cfg80211_external_auth_params *param);void wilc_scan_complete_received (struct wilc *wilc,u8 *buffer,u32 length);void wilc_network_info_received (struct wilc *wilc,u8 *buffer,u32 length);void wilc_gnrl_async_info_received (struct wilc *wilc,u8 *buffer,u32 length);
drivers/net/wireless/microchip/wilc1000/netdev.c +10 -1
@@ -835,15 +835,24 @@ void wilc_frmw_to_host(struct wilc *wilc, u8 *buff, u32 size, } } -void wilc_wfi_mgmt_rx (struct wilc *wilc,u8 *buff,u32 size) +void wilc_wfi_mgmt_rx (struct wilc *wilc,u8 *buff,u32 size,bool is_auth) {int srcu_idx;struct wilc_vif *vif; srcu_idx =srcu_read_lock (&wilc->srcu);list_for_each_entry_rcu (vif, &wilc->vif_list, list) { +struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)buff;u16 type =le16_to_cpup ((__le16 *)buff);u32 type_bit =BIT (type >>4 ); +u32 auth_bit =BIT (IEEE80211_STYPE_AUTH >>4 ); + +if ((vif->mgmt_reg_stypes & auth_bit && +ieee80211_is_auth (mgmt->frame_control)) && + vif->iftype ==WILC_STATION_MODE && is_auth) { +wilc_wfi_mgmt_frame_rx (vif, buff, size); +break ; + }if (vif->priv.p2p_listen_state && vif->mgmt_reg_stypes & type_bit)
drivers/net/wireless/microchip/wilc1000/netdev.h +2 -1
@@ -185,6 +185,7 @@ struct wilc_vif {struct wilc_priv priv;struct list_head list;struct cfg80211_bss *bss; +struct cfg80211_external_auth_params auth; };struct wilc_tx_queue_status {
@@ -278,7 +279,7 @@ struct wilc_wfi_mon_priv {void wilc_frmw_to_host (struct wilc *wilc,u8 *buff,u32 size,u32 pkt_offset);void wilc_mac_indicate (struct wilc *wilc);void wilc_netdev_cleanup (struct wilc *wilc); -void wilc_wfi_mgmt_rx (struct wilc *wilc,u8 *buff,u32 size); +void wilc_wfi_mgmt_rx (struct wilc *wilc,u8 *buff,u32 size,bool is_auth);void wilc_wlan_set_bssid (struct net_device *wilc_netdev,const u8 *bssid,u8 mode); struct wilc_vif *wilc_netdev_ifc_init(struct wilc *wl, const char *name,
drivers/net/wireless/microchip/wilc1000/wlan.c +2 -1
@@ -968,7 +968,8 @@ static void wilc_wlan_handle_rx_buff(struct wilc *wilc, u8 *buffer, int size)if (pkt_offset &IS_MANAGMEMENT ) { buff_ptr +=HOST_HDR_OFFSET ; -wilc_wfi_mgmt_rx (wilc, buff_ptr, pkt_len); +wilc_wfi_mgmt_rx (wilc, buff_ptr, pkt_len, + pkt_offset &IS_MGMT_AUTH_PKT ); }else {if (!is_cfg_packet) { wilc_frmw_to_host(wilc, buff_ptr, pkt_len,
drivers/net/wireless/microchip/wilc1000/wlan.h +2 -0
@@ -305,6 +305,7 @@#define IS_MANAGMEMENT 0x100#define IS_MANAGMEMENT_CALLBACK 0x080#define IS_MGMT_STATUS_SUCCES 0x040 +#define IS_MGMT_AUTH_PKT 0x010#define WILC_WID_TYPE GENMASK(15, 12)#define WILC_VMM_ENTRY_FULL_RETRY 1
@@ -423,6 +424,7 @@ int wilc_wlan_get_num_conn_ifcs(struct wilc *wilc);netdev_tx_t wilc_mac_xmit (struct sk_buff *skb,struct net_device *dev);void wilc_wfi_p2p_rx (struct wilc_vif *vif,u8 *buff,u32 size); +bool wilc_wfi_mgmt_frame_rx (struct wilc_vif *vif,u8 *buff,u32 size);void host_wakeup_notify (struct wilc *wilc);void host_sleep_notify (struct wilc *wilc);void chip_allow_sleep (struct wilc *wilc);
drivers/net/wireless/microchip/wilc1000/wlan_if.h +7 -3
@@ -85,7 +85,10 @@ enum authtype {WILC_FW_AUTH_OPEN_SYSTEM =1 ,WILC_FW_AUTH_SHARED_KEY =2 ,WILC_FW_AUTH_ANY =3 , -WILC_FW_AUTH_IEEE8021 =5 +WILC_FW_AUTH_IEEE8021 =5 , +WILC_FW_AUTH_SAE =7 , +WILC_FW_AUTH_IEE8021X_SHA256 =9 , +WILC_FW_AUTH_OPEN_SYSTEM_SHA256 =13 }; enum site_survey {
@@ -176,7 +179,8 @@ enum {enum {WILC_FW_ACTION_FRM_IDX =0 , -WILC_FW_PROBE_REQ_IDX =1 +WILC_FW_PROBE_REQ_IDX =1 , +WILC_FW_AUTH_REQ_IDX =2 };enum wid_type {
@@ -789,7 +793,7 @@ enum {WID_ADD_BEACON =0x408a ,WID_SETUP_MULTICAST_FILTER =0x408b , - +WID_EXTERNAL_AUTH_PARAM =0x408d ,/* Miscellaneous WIDs */ WID_ALL =0x7FFE ,WID_MAX =0xFFFF
Signature · 1 line
2.25.1
[email protected]
maintainerPATCH v3 4/4 wilc1000: add IGTK support
In reply to [email protected]From: Ajay Singh <[email protected]>
Add support to handle IGTK keys which are required for MFP to FW. Index ID 4 and 5 are used to store the IGTK key.
--- .../wireless/microchip/wilc1000/cfg80211.c | 114 ++++++++++++++---- drivers/net/wireless/microchip/wilc1000/fw.h | 8 ++ drivers/net/wireless/microchip/wilc1000/hif.c | 56 ++++++++- drivers/net/wireless/microchip/wilc1000/hif.h | 5 + .../net/wireless/microchip/wilc1000/netdev.h | 1 + .../net/wireless/microchip/wilc1000/wlan_if.h | 10 ++ 6 files changed, 171 insertions(+), 23 deletions(-)
drivers/net/wireless/microchip/wilc1000/cfg80211.c +92 -22
@@ -307,6 +307,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,int ret;u32 i;u8 security =WILC_FW_SEC_NO ; +enum mfptype mfp_type =WILC_FW_MFP_NONE ;enum authtype auth_type =WILC_FW_AUTH_ANY ;u32 cipher_group;struct cfg80211_bss *bss;
@@ -416,6 +417,13 @@ static int connect(struct wiphy *wiphy, struct net_device *dev, wfi_drv->conn_info.arg = priv; wfi_drv->conn_info.param = join_params; +if (sme->mfp ==NL80211_MFP_OPTIONAL ) + mfp_type =WILC_FW_MFP_OPTIONAL ; +else if (sme->mfp ==NL80211_MFP_REQUIRED ) + mfp_type =WILC_FW_MFP_REQUIRED ; + + wfi_drv->conn_info.mfp_type = mfp_type; + ret =wilc_set_join_req (vif, bss->bssid, sme->ie, sme->ie_len);if (ret) {netdev_err (dev,"wilc_set_join_req(): Error\n" );
@@ -495,6 +503,18 @@ static int wilc_wfi_cfg_allocate_wpa_entry(struct wilc_priv *priv, u8 idx)return 0 ; } +static int wilc_wfi_cfg_allocate_wpa_igtk_entry (struct wilc_priv *priv,u8 idx) +{ + idx -=4 ; +if (!priv->wilc_igtk[idx]) { + priv->wilc_igtk[idx] =kzalloc (sizeof (*priv->wilc_igtk[idx]), +GFP_KERNEL ); +if (!priv->wilc_igtk[idx]) +return -ENOMEM ; + } +return 0 ; +} +static int wilc_wfi_cfg_copy_wpa_info (struct wilc_wfi_key *key_info,struct key_params *params) {
@@ -531,6 +551,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,u8 op_mode;struct wilc_vif *vif =netdev_priv (netdev);struct wilc_priv *priv = &vif->priv; +struct wilc_wfi_key *key;switch (params->cipher) {case WLAN_CIPHER_SUITE_TKIP :
@@ -594,6 +615,26 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index, key_index);break ; +case WLAN_CIPHER_SUITE_AES_CMAC : + ret =wilc_wfi_cfg_allocate_wpa_igtk_entry (priv, key_index); +if (ret) +return -ENOMEM ; + + key = priv->wilc_igtk[key_index -4 ]; + ret =wilc_wfi_cfg_copy_wpa_info (key, params); +if (ret) +return -ENOMEM ; + +if (priv->wdev.iftype ==NL80211_IFTYPE_AP || + priv->wdev.iftype ==NL80211_IFTYPE_P2P_GO ) + op_mode =WILC_AP_MODE ; +else + op_mode =WILC_STATION_MODE ; + + ret =wilc_add_igtk (vif, params->key, keylen, params->seq, + params->seq_len, mac_addr, op_mode, + key_index); +break ;default :netdev_err (netdev,"%s: Unsupported cipher\n" , __func__);
@@ -611,23 +652,34 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,struct wilc_vif *vif =netdev_priv (netdev);struct wilc_priv *priv = &vif->priv; -if (priv->wilc_gtk[key_index]) { -kfree (priv->wilc_gtk[key_index]->key); - priv->wilc_gtk[key_index]->key =NULL ; -kfree (priv->wilc_gtk[key_index]->seq); - priv->wilc_gtk[key_index]->seq =NULL ; - -kfree (priv->wilc_gtk[key_index]); - priv->wilc_gtk[key_index] =NULL ; - } - -if (priv->wilc_ptk[key_index]) { -kfree (priv->wilc_ptk[key_index]->key); - priv->wilc_ptk[key_index]->key =NULL ; -kfree (priv->wilc_ptk[key_index]->seq); - priv->wilc_ptk[key_index]->seq =NULL ; -kfree (priv->wilc_ptk[key_index]); - priv->wilc_ptk[key_index] =NULL ; +if (!pairwise && (key_index ==4 || key_index ==5 )) { + key_index -=4 ; +if (priv->wilc_igtk[key_index]) { +kfree (priv->wilc_igtk[key_index]->key); + priv->wilc_igtk[key_index]->key =NULL ; +kfree (priv->wilc_igtk[key_index]->seq); + priv->wilc_igtk[key_index]->seq =NULL ; +kfree (priv->wilc_igtk[key_index]); + priv->wilc_igtk[key_index] =NULL ; + } + }else { +if (priv->wilc_gtk[key_index]) { +kfree (priv->wilc_gtk[key_index]->key); + priv->wilc_gtk[key_index]->key =NULL ; +kfree (priv->wilc_gtk[key_index]->seq); + priv->wilc_gtk[key_index]->seq =NULL ; + +kfree (priv->wilc_gtk[key_index]); + priv->wilc_gtk[key_index] =NULL ; + } +if (priv->wilc_ptk[key_index]) { +kfree (priv->wilc_ptk[key_index]->key); + priv->wilc_ptk[key_index]->key =NULL ; +kfree (priv->wilc_ptk[key_index]->seq); + priv->wilc_ptk[key_index]->seq =NULL ; +kfree (priv->wilc_ptk[key_index]); + priv->wilc_ptk[key_index] =NULL ; + } }return 0 ;
@@ -642,11 +694,20 @@ static int get_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,struct key_params key_params;if (!pairwise) { - key_params.key = priv->wilc_gtk[key_index]->key; - key_params.cipher = priv->wilc_gtk[key_index]->cipher; - key_params.key_len = priv->wilc_gtk[key_index]->key_len; - key_params.seq = priv->wilc_gtk[key_index]->seq; - key_params.seq_len = priv->wilc_gtk[key_index]->seq_len; +if (key_index ==4 || key_index ==5 ) { + key_index -=4 ; + key_params.key = priv->wilc_igtk[key_index]->key; + key_params.cipher = priv->wilc_igtk[key_index]->cipher; + key_params.key_len = priv->wilc_igtk[key_index]->key_len; + key_params.seq = priv->wilc_igtk[key_index]->seq; + key_params.seq_len = priv->wilc_igtk[key_index]->seq_len; + }else { + key_params.key = priv->wilc_gtk[key_index]->key; + key_params.cipher = priv->wilc_gtk[key_index]->cipher; + key_params.key_len = priv->wilc_gtk[key_index]->key_len; + key_params.seq = priv->wilc_gtk[key_index]->seq; + key_params.seq_len = priv->wilc_gtk[key_index]->seq_len; + } }else { key_params.key = priv->wilc_ptk[key_index]->key; key_params.cipher = priv->wilc_ptk[key_index]->cipher;
@@ -667,6 +728,14 @@ static int set_default_key(struct wiphy *wiphy, struct net_device *netdev,return 0 ; } +static int set_default_mgmt_key (struct wiphy *wiphy,struct net_device *netdev, +u8 key_index) +{ +struct wilc_vif *vif =netdev_priv (netdev); + +return wilc_set_default_mgmt_key_index (vif, key_index); +} +static int get_station (struct wiphy *wiphy,struct net_device *dev,const u8 *mac,struct station_info *sinfo) {
@@ -1626,6 +1695,7 @@ static const struct cfg80211_ops wilc_cfg80211_ops = { .del_key = del_key, .get_key = get_key, .set_default_key = set_default_key, + .set_default_mgmt_key = set_default_mgmt_key, .add_virtual_intf = add_virtual_intf, .del_virtual_intf = del_virtual_intf, .change_virtual_intf = change_virtual_intf,
drivers/net/wireless/microchip/wilc1000/fw.h +8 -0
@@ -54,6 +54,14 @@ struct wilc_ap_wpa_ptk {u8 key[]; } __packed; +struct wilc_wpa_igtk { +u8 index; +u8 pn_len; +u8 pn[6 ]; +u8 key_len; +u8 key[]; +} __packed; +struct wilc_gtk_key {u8 mac_addr[ETH_ALEN ];u8 rsc[8 ];
drivers/net/wireless/microchip/wilc1000/hif.c +55 -1
76 lines not on this page · raw message
drivers/net/wireless/microchip/wilc1000/hif.h +5 -0
@@ -108,6 +108,7 @@ struct wilc_conn_info {u8 bssid[ETH_ALEN ];u8 security;enum authtype auth_type; +enum mfptype mfp_type;u8 ch;u8 *req_ies;size_t req_ies_len;
@@ -155,6 +156,9 @@ struct wilc_vif;int wilc_add_ptk (struct wilc_vif *vif,const u8 *ptk,u8 ptk_key_len,const u8 *mac_addr,const u8 *rx_mic,const u8 *tx_mic,u8 mode,u8 cipher_mode,u8 index); +int wilc_add_igtk (struct wilc_vif *vif,const u8 *igtk,u8 igtk_key_len, +const u8 *pn,u8 pn_len,const u8 *mac_addr,u8 mode, +u8 index);s32 wilc_get_inactive_time (struct wilc_vif *vif,const u8 *mac,u32 *out_val); int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len,
@@ -210,4 +214,5 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length);void wilc_gnrl_async_info_received (struct wilc *wilc,u8 *buffer,u32 length);void *wilc_parse_join_bss_param (struct cfg80211_bss *bss,struct cfg80211_crypto_settings *crypto); +int wilc_set_default_mgmt_key_index (struct wilc_vif *vif,u8 index);#endif
drivers/net/wireless/microchip/wilc1000/netdev.h +1 -0
@@ -129,6 +129,7 @@ struct wilc_priv {struct net_device *real_ndev;struct wilc_wfi_key *wilc_gtk[WILC_MAX_NUM_STA ];struct wilc_wfi_key *wilc_ptk[WILC_MAX_NUM_STA ]; +struct wilc_wfi_key *wilc_igtk[2 ];u8 wilc_groupkey;/* mutexes */
drivers/net/wireless/microchip/wilc1000/wlan_if.h +10 -0
@@ -91,6 +91,12 @@ enum authtype {WILC_FW_AUTH_OPEN_SYSTEM_SHA256 =13 }; +enum mfptype { +WILC_FW_MFP_NONE =0x0 , +WILC_FW_MFP_OPTIONAL =0x1 , +WILC_FW_MFP_REQUIRED =0x2 +}; +enum site_survey {WILC_FW_SITE_SURVEY_1CH =0 ,WILC_FW_SITE_SURVEY_ALL_CH =1 ,
@@ -661,6 +667,9 @@ enum {WID_LOG_TERMINAL_SWITCH =0x00CD ,WID_TX_POWER =0x00CE ,WID_WOWLAN_TRIGGER =0X00CF , +WID_SET_MFP =0x00D0 , + +WID_DEFAULT_MGMT_KEY_ID =0x00D2 ,/* EMAC Short WID list */ /* RTS Threshold */ /*
@@ -750,6 +759,7 @@ enum {WID_REMOVE_KEY =0x301E ,WID_ASSOC_REQ_INFO =0x301F ,WID_ASSOC_RES_INFO =0x3020 , +WID_ADD_IGTK =0x3022 ,WID_MANUFACTURER =0x3026 ,/* Added for CAPI tool */ WID_MODEL_NAME =0x3027 ,/* Added for CAPI tool */ WID_MODEL_NUM = 0x3028, /* Added for CAPI tool */
Signature · 1 line
2.25.1
Re: [v3,1/4] wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down
In reply to [email protected]Quoted 9 lines · <[email protected]> wrote:
From: Ajay Singh <[email protected]>
For power-up sequence, WILC expects RESET set to high 5ms after making
chip_en(enable)so corrected chip power-up sequence by making RESET high. For Power-Down sequence, the correct sequence make RESET andCHIP_ENlow without any extra delay.Fixes ec031ac4792c ("wilc1000: Add reset/enable GPIO support to SPI driver")Signed-off-by Ajay Singh <[email protected]>
4 patches applied to wireless-next.git, thanks.
fcf690b0b474 wifi: wilc1000: use correct sequence of RESET for chip Power-UP/Down 3c76ec880588 wifi: wilc1000: remove WEP security support c5b331d4f550 wifi: wilc1000: add WPA3 SAE support0e703de3ef41 wifi: wilc1000: add IGTK support
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches