rsi: support for AP mode
cover rsi: support for AP mode
From: Amitkumar Karwar <[email protected]>
This patchset contains enhancements for AP mode operation. Major changes are maintaining the station structures in driver and adding station id parameter to the Tx packets whenever required.
Tests are performed to confirm aggregation, connections in WEP and WPA security.
Prameela Rani Garnepudi (11):
rsi: advertise ap mode support
rsi: add interface changes for ap mode
rsi: remove interface changes for AP mode
rsi: add beacon changes for AP mode
rsi: handle station connection in AP mode
rsi: handle station disconnection in AP mode
rsi: data and managemet path changes for AP mode
rsi: use common descriptor for auto rate frame
rsi: update tx auto rate command frame for AP mode
rsi: aggregation parameters frame for AP mode
rsi: security enhancements for AP mode
drivers/net/wireless/rsi/rsi_91x_core.c | 70 ++++-- drivers/net/wireless/rsi/rsi_91x_hal.c | 129 +++++++++-- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 344 +++++++++++++++++++++++----- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 180 +++++++++++---- drivers/net/wireless/rsi/rsi_common.h | 1 + drivers/net/wireless/rsi/rsi_hal.h | 4 +- drivers/net/wireless/rsi/rsi_main.h | 27 ++- drivers/net/wireless/rsi/rsi_mgmt.h | 35 ++- 8 files changed, 643 insertions(+), 147 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/11 rsi: advertise ap mode support
From: Prameela Rani Garnepudi <[email protected]>
AP mode support is advertised to cfg80211. Necessary wiphy parameters are initialized.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 28 +++++++++++++++++++++++++++- drivers/net/wireless/rsi/rsi_main.h | 10 ++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +27 -1
@@ -122,6 +122,23 @@ const u16 rsi_mcsrates[8] = { RSI_RATE_MCS4, RSI_RATE_MCS5, RSI_RATE_MCS6, RSI_RATE_MCS7 }; +static const u32 rsi_max_ap_stas[16 ] = { +32 ,/* 1 - Wi-Fi alone */ +0 ,/* 2 */ +0 ,/* 3 */ +0 ,/* 4 - BT EDR alone */ +4 ,/* 5 - STA + BT EDR */ +32 ,/* 6 - AP + BT EDR */ +0 ,/* 7 */ +0 ,/* 8 - BT LE alone */ +4 ,/* 9 - STA + BE LE */ +0 ,/* 10 */ +0 ,/* 11 */ +0 ,/* 12 */ +1 ,/* 13 - STA + BT Dual */ +4 ,/* 14 - AP + BT Dual */ +}; +/** * rsi_is_cipher_wep() - This function determines if the cipher is WEP or not. * @common: Pointer to the driver private structure.
@@ -1348,7 +1365,8 @@ int rsi_mac80211_attach(struct rsi_common *common)SET_IEEE80211_PERM_ADDR (hw, common->mac_addr);ether_addr_copy (hw->wiphy->addr_mask, addr_mask); - wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ); + wiphy->interface_modes =BIT (NL80211_IFTYPE_STATION ) | +BIT (NL80211_IFTYPE_AP ); wiphy->signal_type =CFG80211_SIGNAL_TYPE_MBM ; wiphy->retry_short =RETRY_SHORT ; wiphy->retry_long =RETRY_LONG ;
@@ -1363,6 +1381,14 @@ int rsi_mac80211_attach(struct rsi_common *common) wiphy->bands[NL80211_BAND_5GHZ ] = &adapter->sbands[NL80211_BAND_5GHZ ]; +/* AP Parameters */ + wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode -1 ]; + common->max_stations = wiphy->max_ap_assoc_sta; +rsi_dbg (ERR_ZONE ,"Max Stations Allowed = %d\n" , common->max_stations); + hw->sta_data_size =sizeof (struct rsi_sta ); + wiphy->flags =WIPHY_FLAG_REPORTS_OBSS ; + wiphy->flags |=WIPHY_FLAG_AP_UAPSD ; + wiphy->features |=NL80211_FEATURE_INACTIVITY_TIMER ; wiphy->reg_notifier = rsi_reg_notify;wiphy_ext_feature_set (wiphy,NL80211_EXT_FEATURE_CQM_RSSI_LIST );
drivers/net/wireless/rsi/rsi_main.h +10 -0
@@ -21,6 +21,13 @@#include <linux/skbuff.h> #include <net/mac80211.h> +struct rsi_sta { +struct ieee80211_sta *sta; +s16 sta_id; +u16 seq_start[IEEE80211_NUM_TIDS ]; +bool start_tx_aggr[IEEE80211_NUM_TIDS ]; +}; +struct rsi_hw ;#include "rsi_ps.h"
@@ -253,6 +260,9 @@ struct rsi_common {u16 beacon_interval;u8 dtim_cnt; + +/* AP mode parameters */ +int max_stations; };enum host_intf {
Signature · 1 line
2.7.4
PATCH 2/11 rsi: add interface changes for ap mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
AP mode is handled in add_interface callback of mac80211. Also for AP mode, sending rx filter frame to disallow beacons to host is added. Station structures are initialized to NULL.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 43 +++++++++++++++++++++++------ drivers/net/wireless/rsi/rsi_91x_mgmt.c | 5 ++-- drivers/net/wireless/rsi/rsi_main.h | 3 ++ drivers/net/wireless/rsi/rsi_mgmt.h | 6 ++-- 4 files changed, 44 insertions(+), 13 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +35 -8
@@ -342,25 +342,51 @@ static int rsi_mac80211_add_interface(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +enum opmode intf_mode;int ret = -EOPNOTSUPP ; vif->driver_flags |=IEEE80211_VIF_SUPPORTS_UAPSD ;mutex_lock (&common->mutex); + +if (adapter->sc_nvifs >1 ) { +mutex_unlock (&common->mutex); +return -EOPNOTSUPP ; + } +switch (vif->type) {case NL80211_IFTYPE_STATION : -if (!adapter->sc_nvifs) { - ++adapter->sc_nvifs; - adapter->vifs[0 ] = vif; - ret =rsi_set_vap_capabilities (common, -STA_OPMODE , -VAP_ADD ); - } +rsi_dbg (INFO_ZONE ,"Station Mode" ); + intf_mode =STA_OPMODE ; +break ; +case NL80211_IFTYPE_AP : +rsi_dbg (INFO_ZONE ,"AP Mode" ); + intf_mode =AP_OPMODE ;break ;default :rsi_dbg (ERR_ZONE ,"%s: Interface type %d not supported\n" , __func__, vif->type); + goto out; } + + adapter->vifs[adapter->sc_nvifs++] = vif; + ret =rsi_set_vap_capabilities (common, intf_mode, common->mac_addr, +0 ,VAP_ADD ); +if (ret) { +rsi_dbg (ERR_ZONE ,"Failed to set VAP capabilities\n" ); + goto out; + } + +if (vif->type ==NL80211_IFTYPE_AP ) { +int i; + +rsi_send_rx_filter_frame (common,DISALLOW_BEACONS ); + common->min_rate =RSI_RATE_AUTO ; +for (i =0 ; i < common->max_stations; i++) + common->stations[i].sta =NULL ; + } + +out:mutex_unlock (&common->mutex);return ret;
@@ -383,7 +409,8 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw,mutex_lock (&common->mutex);if (vif->type ==NL80211_IFTYPE_STATION ) { adapter->sc_nvifs--; -rsi_set_vap_capabilities (common,STA_OPMODE ,VAP_DELETE ); +rsi_set_vap_capabilities (common,STA_OPMODE , vif->addr, +0 ,VAP_DELETE ); }if (!memcmp (adapter->vifs[0 ], vif,sizeof (struct ieee80211_vif )))
drivers/net/wireless/rsi/rsi_91x_mgmt.c +3 -2
@@ -624,6 +624,8 @@ static int rsi_program_bb_rf(struct rsi_common *common)*/ int rsi_set_vap_capabilities (struct rsi_common *common,enum opmode mode, +u8 *mac_addr, +u8 vap_id,u8 vap_status) {struct sk_buff *skb =NULL ;
@@ -632,7 +634,6 @@ int rsi_set_vap_capabilities(struct rsi_common *common,struct ieee80211_hw *hw = adapter->hw;struct ieee80211_conf *conf = &hw->conf;u16 frame_len =sizeof (struct rsi_vap_caps ); -u16 vap_id =0 ;rsi_dbg (MGMT_TX_ZONE ,"%s: Sending VAP capabilities frame\n" , __func__);
@@ -656,7 +657,7 @@ int rsi_set_vap_capabilities(struct rsi_common *common, vap_caps->radioid_macid = ((common->mac_id &0xf ) <<4 ) | (common->radio_id &0xf ); -memcpy (vap_caps->mac_addr, common->mac_addr,IEEE80211_ADDR_LEN ); +memcpy (vap_caps->mac_addr, mac_addr,IEEE80211_ADDR_LEN ); vap_caps->keep_alive_period =cpu_to_le16 (90 ); vap_caps->frag_threshold =cpu_to_le16 (IEEE80211_MAX_FRAG_THRESHOLD );
drivers/net/wireless/rsi/rsi_main.h +3 -0
@@ -90,6 +90,7 @@ extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...);#define IEEE80211_MGMT_FRAME 0x00#define IEEE80211_CTL_FRAME 0x04 +#define RSI_MAX_ASSOC_STAS 32#define IEEE80211_QOS_TID 0x0f#define IEEE80211_NONQOS_TID 16
@@ -262,6 +263,8 @@ struct rsi_common {u8 dtim_cnt;/* AP mode parameters */ +struct rsi_sta stations[RSI_MAX_ASSOC_STAS +1 ]; +int num_stations;int max_stations; };
drivers/net/wireless/rsi/rsi_mgmt.h +3 -3
@@ -188,8 +188,8 @@ IEEE80211_WMM_IE_STA_QOSINFO_AC_BK)enum opmode { -STA_OPMODE =1 , -AP_OPMODE =2 +AP_OPMODE =0 , +STA_OPMODE , };enum vap_status {
@@ -591,7 +591,7 @@ static inline void rsi_set_len_qno(__le16 *addr, u16 len, u8 qno)int rsi_mgmt_pkt_recv (struct rsi_common *common,u8 *msg);int rsi_set_vap_capabilities (struct rsi_common *common,enum opmode mode, -u8 vap_status); +u8 *mac_addr,u8 vap_id,u8 vap_status);int rsi_send_aggregation_params_frame (struct rsi_common *common,u16 tid,u16 ssn,u8 buf_size,u8 event); int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,
Signature · 1 line
2.7.4
PATCH 3/11 rsi: remove interface changes for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
remove_interface callback of mac80211 is handled for AP mode. Same is notified to firmware through vap_capabilities frame with VAP status VAP_DELETE.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +22 -4
@@ -405,13 +405,31 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +enum opmode opmode; + +rsi_dbg (INFO_ZONE ,"Remove Interface Called\n" );mutex_lock (&common->mutex); -if (vif->type ==NL80211_IFTYPE_STATION ) { - adapter->sc_nvifs--; -rsi_set_vap_capabilities (common,STA_OPMODE , vif->addr, -0 ,VAP_DELETE ); + +if (adapter->sc_nvifs <=0 ) { +mutex_unlock (&common->mutex); +return ; + } + +switch (vif->type) { +case NL80211_IFTYPE_STATION : + opmode =STA_OPMODE ; +break ; +case NL80211_IFTYPE_AP : + opmode =AP_OPMODE ; +break ; +default : +mutex_unlock (&common->mutex); +return ; } +rsi_set_vap_capabilities (common, opmode, vif->addr, +0 ,VAP_DELETE ); + adapter->sc_nvifs--;if (!memcmp (adapter->vifs[0 ], vif,sizeof (struct ieee80211_vif ))) adapter->vifs[0 ] =NULL ;
Signature · 1 line
2.7.4
PATCH 4/11 rsi: add beacon changes for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
Mac80211 config parameter BEACON_ENABLE is handled. When VAP capabilities frame with AP mode is configured to firmware, beacon events start coming to host at each PreTBTT. At this time, beacon is taken from mac80211, descriptor is prepared and send to firmware.
--- drivers/net/wireless/rsi/rsi_91x_core.c | 15 +++++-- drivers/net/wireless/rsi/rsi_91x_hal.c | 65 ++++++++++++++++++++++++++++- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 12 ++++++ drivers/net/wireless/rsi/rsi_91x_mgmt.c | 48 ++++++++++++++++++--- drivers/net/wireless/rsi/rsi_hal.h | 2 + drivers/net/wireless/rsi/rsi_main.h | 13 +++--- drivers/net/wireless/rsi/rsi_mgmt.h | 11 +++++ 7 files changed, 152 insertions(+), 14 deletions(-)
drivers/net/wireless/rsi/rsi_91x_core.c +12 -3
@@ -16,6 +16,7 @@#include "rsi_mgmt.h" #include "rsi_common.h" +#include "rsi_hal.h" /** * rsi_determine_min_weight_queue() - This function determines the queue with
@@ -136,6 +137,10 @@ static u8 rsi_core_determine_hal_queue(struct rsi_common *common)u8 q_num =INVALID_QUEUE ;u8 ii =0 ; +if (skb_queue_len (&common->tx_queue[MGMT_BEACON_Q ])) { + q_num =MGMT_BEACON_Q ; +return q_num; + }if (skb_queue_len (&common->tx_queue[MGMT_SOFT_Q ])) {if (!common->mgmt_q_block) q_num =MGMT_SOFT_Q ;
@@ -291,10 +296,14 @@ void rsi_core_qos_processor(struct rsi_common *common)break ; } -if (q_num ==MGMT_SOFT_Q ) +if (q_num ==MGMT_SOFT_Q ) { status =rsi_send_mgmt_pkt (common, skb); -else + }else if (q_num ==MGMT_BEACON_Q ) { + status =rsi_send_pkt_to_bus (common, skb); +dev_kfree_skb (skb); + }else { status =rsi_send_data_pkt (common, skb); + }if (status) {mutex_unlock (&common->tx_lock);
@@ -358,7 +367,7 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb) tx_params->sta_id =0 ; } -if ((q_num !=MGMT_SOFT_Q ) && +if ((q_num <MGMT_SOFT_Q ) && ((skb_queue_len (&common->tx_queue[q_num]) +1 ) >=DATA_QUEUE_WATER_MARK )) {rsi_dbg (ERR_ZONE ,"%s: sw queue full\n" , __func__);
drivers/net/wireless/rsi/rsi_91x_hal.c +64 -1
77 lines not on this page · raw message
drivers/net/wireless/rsi/rsi_91x_mac80211.c +12 -0
@@ -652,6 +652,18 @@ static void rsi_mac80211_bss_info_changed(struct ieee80211_hw *hw, common->cqm_info.rssi_thold, common->cqm_info.rssi_hyst); } + +if ((changed &BSS_CHANGED_BEACON_ENABLED ) && + (vif->type ==NL80211_IFTYPE_AP )) { +if (bss->enable_beacon) { +rsi_dbg (INFO_ZONE ,"===> BEACON ENABLED <===\n" ); + common->beacon_enabled =1 ; + }else { +rsi_dbg (INFO_ZONE ,"===> BEACON DISABLED <===\n" ); + common->beacon_enabled =0 ; + } + } +mutex_unlock (&common->mutex); }
drivers/net/wireless/rsi/rsi_91x_mgmt.c +43 -5
76 lines not on this page · raw message
drivers/net/wireless/rsi/rsi_hal.h +2 -0
@@ -144,5 +144,7 @@ struct rsi_data_desc { } __packed;int rsi_hal_device_init (struct rsi_hw *adapter); +int rsi_prepare_beacon (struct rsi_common *common,struct sk_buff *skb); +int rsi_send_pkt_to_bus (struct rsi_common *common,struct sk_buff *skb);#endif
drivers/net/wireless/rsi/rsi_main.h +8 -5
@@ -72,7 +72,7 @@ extern __printf(2, 3) void rsi_dbg(u32 zone, const char *fmt, ...);#define MULTICAST_WATER_MARK 200#define MAC_80211_HDR_FRAME_CONTROL 0#define WME_NUM_AC 4 -#define NUM_SOFT_QUEUES 5 +#define NUM_SOFT_QUEUES 6#define MAX_HW_QUEUES 12#define INVALID_QUEUE 0xff#define MAX_CONTINUOUS_VO_PKTS 8
@@ -131,7 +131,8 @@ enum edca_queue {BE_Q ,VI_Q ,VO_Q , -MGMT_SOFT_Q +MGMT_SOFT_Q , +MGMT_BEACON_Q }; struct security_info {
@@ -148,8 +149,8 @@ struct wmm_qinfo { };struct transmit_q_stats { -u32 total_tx_pkt_send[NUM_EDCA_QUEUES +1 ]; -u32 total_tx_pkt_freed[NUM_EDCA_QUEUES +1 ]; +u32 total_tx_pkt_send[NUM_EDCA_QUEUES +2 ]; +u32 total_tx_pkt_freed[NUM_EDCA_QUEUES +2 ]; };struct vif_priv {
@@ -199,7 +200,7 @@ struct rsi_common {struct version_info fw_ver;struct rsi_thread tx_thread; -struct sk_buff_head tx_queue[NUM_EDCA_QUEUES +1 ]; +struct sk_buff_head tx_queue[NUM_EDCA_QUEUES +2 ];/* Mutex declaration */ struct mutex mutex;/* Mutex used for tx thread */
@@ -263,6 +264,8 @@ struct rsi_common {u8 dtim_cnt;/* AP mode parameters */ +u8 beacon_enabled; +u16 beacon_cnt;struct rsi_sta stations[RSI_MAX_ASSOC_STAS +1 ];int num_stations;int max_stations;
drivers/net/wireless/rsi/rsi_mgmt.h +11 -0
@@ -49,6 +49,7 @@#define TA_CONFIRM_TYPE 0x01#define RX_DOT11_MGMT 0x02#define TX_STATUS_IND 0x04 +#define BEACON_EVENT_IND 0x08#define PROBEREQ_CONFIRM 2#define CARD_READY_IND 0x00
@@ -187,6 +188,16 @@ IEEE80211_WMM_IE_STA_QOSINFO_AC_BE | \ IEEE80211_WMM_IE_STA_QOSINFO_AC_BK) +#define RSI_DATA_DESC_MAC_BBP_INFO BIT(0) +#define RSI_DATA_DESC_NO_ACK_IND BIT(9) +#define RSI_DATA_DESC_QOS_EN BIT(12) +#define RSI_DATA_DESC_NORMAL_FRAME 0x00 +#define RSI_DATA_DESC_DTIM_BEACON_GATED_FRAME BIT(10) +#define RSI_DATA_DESC_BEACON_FRAME BIT(11) +#define RSI_DATA_DESC_DTIM_BEACON (BIT(10) | BIT(11)) +#define RSI_DATA_DESC_INSERT_TSF BIT(15) +#define RSI_DATA_DESC_INSERT_SEQ_NO BIT(2) +enum opmode {AP_OPMODE =0 ,STA_OPMODE ,
Signature · 1 line
2.7.4
PATCH 5/11 rsi: handle station connection in AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
Station structures are maintained in driver with required fields. When mac80211 callback sta_add is called, driver iterates through list of connected stations to check available index and assigns station id which is important for further communication to that station. Then peer notify frame is send to firmware to inform the firmware about new station connection.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 79 ++++++++++++++++++++++++++--- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 49 +++++++++++------- drivers/net/wireless/rsi/rsi_mgmt.h | 9 +++- 3 files changed, 111 insertions(+), 26 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +72 -7
@@ -626,10 +626,12 @@ static void rsi_mac80211_bss_info_changed(struct ieee80211_hw *hw,rsi_send_rx_filter_frame (common, rx_filter_word); }rsi_inform_bss_status (common, +STA_OPMODE , bss_conf->assoc, bss_conf->bssid, bss_conf->qos, - bss_conf->aid); + bss_conf->aid, +NULL ,0 ); adapter->ps_info.dtim_interval_duration = bss->dtim_period; adapter->ps_info.listen_interval = conf->listen_interval;
@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +bool sta_exist = false; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );mutex_lock (&common->mutex); -rsi_set_min_rate (hw, sta, common); +if (vif->type ==NL80211_IFTYPE_AP ) { +u8 cnt; +int sta_idx =-1 ; +int free_index =-1 ; + +/* Check if max stations reached */ +if (common->num_stations >= common->max_stations) { +rsi_dbg (ERR_ZONE ,"Reject: Max Stations exists\n" ); +mutex_unlock (&common->mutex); +return -EOPNOTSUPP ; + } +for (cnt =0 ; cnt < common->max_stations; cnt++) { + rsta = &common->stations[cnt]; -if ((sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_20 ) || - (sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_40 )) { - common->vif_info[0 ].sgi = true; +if (!rsta->sta) { +if (free_index <0 ) + free_index = cnt; +continue ; + } +if (!memcmp (rsta->sta->addr, sta->addr,ETH_ALEN )) { +rsi_dbg (INFO_ZONE ,"Station exists\n" ); + sta_idx = cnt; + sta_exist = true; +break ; + } + } +if (!sta_exist) { +if (free_index >=0 ) + sta_idx = free_index; + } +if (sta_idx <0 ) { +rsi_dbg (ERR_ZONE , +"%s: Some problem reaching here...\n" , + __func__); +return -EINVAL ; + } + rsta = &common->stations[sta_idx]; + rsta->sta = sta; + rsta->sta_id = sta_idx; +for (cnt =0 ; cnt <IEEE80211_NUM_TIDS ; cnt++) + rsta->start_tx_aggr[cnt] = false; +for (cnt =0 ; cnt <IEEE80211_NUM_TIDS ; cnt++) + rsta->seq_start[cnt] =0 ; +if (!sta_exist) { +rsi_dbg (INFO_ZONE ,"New Station\n" ); + +/* Send peer notify to device */ +rsi_dbg (INFO_ZONE ,"Indicate bss status to device\n" ); +rsi_inform_bss_status (common,AP_OPMODE ,1 , sta->addr, + sta->wme, sta->aid, sta, sta_idx); + + common->num_stations++; + } } -if (sta->ht_cap.ht_supported) -ieee80211_start_tx_ba_session (sta,0 ,0 ); +if (vif->type ==NL80211_IFTYPE_STATION ) { +rsi_set_min_rate (hw, sta, common); +if (sta->ht_cap.ht_supported) { + common->vif_info[0 ].is_ht = true; + common->bitrate_mask[NL80211_BAND_2GHZ ] = + sta->supp_rates[NL80211_BAND_2GHZ ]; +if ((sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_20 ) || + (sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_40 )) + common->vif_info[0 ].sgi = true; +ieee80211_start_tx_ba_session (sta,0 ,0 ); + } + }mutex_unlock (&common->mutex);
drivers/net/wireless/rsi/rsi_91x_mgmt.c +32 -17
96 lines not on this page · raw message
drivers/net/wireless/rsi/rsi_mgmt.h +7 -2
@@ -209,6 +209,10 @@ enum vap_status { VAP_UPDATE = 3 }; +enum peer_type { +PEER_TYPE_AP , +PEER_TYPE_STA , +};extern struct ieee80211_rate rsi_rates[12 ];extern const u16 rsi_mcsrates[8 ];
@@ -611,8 +615,9 @@ int rsi_set_channel(struct rsi_common *common, struct ieee80211_channel *channel);int rsi_send_vap_dynamic_update (struct rsi_common *common);int rsi_send_block_unblock_frame (struct rsi_common *common,bool event); -void rsi_inform_bss_status (struct rsi_common *common,u8 status, -const u8 *bssid,u8 qos_enable,u16 aid); +void rsi_inform_bss_status (struct rsi_common *common,enum opmode opmode, +u8 status,const u8 *addr,u8 qos_enable,u16 aid, +struct ieee80211_sta *sta,u16 sta_id);void rsi_indicate_pkt_to_os (struct rsi_common *common,struct sk_buff *skb);int rsi_mac80211_attach (struct rsi_common *common); void rsi_indicate_tx_status(struct rsi_hw *common, struct sk_buff *skb,
Signature · 1 line
2.7.4
Re: [PATCH 05/11] rsi: handle station connection in AP mode
Quoted 11 lines · Amitkumar Karwar
From: Prameela Rani Garnepudi <[email protected]>
Station structures are maintained in driver with required fields. When mac80211 callback
sta_addis called, driver iterates through list of connected stations to check available index and assigns station id which is important for further communication to that station. Then peer notify frame is send to firmware to inform the firmware about new station connection.Signed-off-by Prameela Rani Garnepudi <[email protected]>Signed-off-by Amitkumar Karwar <[email protected]>
[...]
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, · line 1166
Quoted 9 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +5
-0@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +bool sta_exist = false; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );
The driver should not spam the logs every time a client connects, so this should be a debug message.
Signature · 1 line
Kalle Valo
Re: [PATCH 05/11] rsi: handle station connection in AP mode
Hi Kalle,
I will change the debug level and send the updated patches again.
Thanks,
Prameela
Quoted 31 lines · Kalle Valo
Quoted 11 lines · Amitkumar Karwar
From: Prameela Rani Garnepudi <[email protected]>
Station structures are maintained in driver with required fields. When mac80211 callback
sta_addis called, driver iterates through list of connected stations to check available index and assigns station id which is important for further communication to that station. Then peer notify frame is send to firmware to inform the firmware about new station connection.Signed-off-by Prameela Rani Garnepudi <[email protected]>Signed-off-by Amitkumar Karwar <[email protected]>[...]
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, · line 1166
Quoted 9 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +5
-0@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +bool sta_exist = false; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );The driver should not spam the logs every time a client connects, so this should be a debug message.
--
Kalle Valo
Signature · 1 line
G. Prameela Rani (M.Tech,CSE)
Re: [PATCH 05/11] rsi: handle station connection in AP mode
Quoted 6 lines · Prameela Rani Garnepudi
Hi Kalle,
I will change the debug level and send the updated patches again.
Thanks,
Prameela
Please do not top-post.
Quoted 17 lines · Kalle Valo
Quoted 16 lines
Quoted 11 lines · Amitkumar Karwar
From: Prameela Rani Garnepudi <[email protected]>
Station structures are maintained in driver with required fields. When mac80211 callback
sta_addis called, driver iterates through list of connected stations to check available index and assigns station id which is important for further communication to that station. Then peer notify frame is send to firmware to inform the firmware about new station connection.Signed-off-by Prameela Rani Garnepudi <[email protected]>Signed-off-by Amitkumar Karwar <[email protected]>[...]
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +0
-0@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv;Quoted 8 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, · line 1166
Quoted 5 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +5
-0+bool sta_exist = false; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );The driver should not spam the logs every time a client connects, so this should be a debug message.
I am wondering why print_hex_dump() is used for printing the station mac address. Just use: pr_debug("Station add: %pM\n", sta->addr);
Regards,
Arend
Re: [PATCH 05/11] rsi: handle station connection in AP mode
Quoted 13 lines · Arend van Spriel
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +0
-0@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv;Quoted 8 lines
Quoted 8 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, · line 1166
Quoted 5 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +5
-0+bool sta_exist = false; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );The driver should not spam the logs every time a client connects, so this should be a debug message.
Quoted 2 lines
I am wondering why
print_hex_dump()is used for printing the station mac address. Just use:pr_debug("Station add: %pM\n", sta->addr);
Good point. Except that IIRC rsi has it's own debugging macros and you can use those, you don't need to use pr_debug() (unless you want to).
Signature · 1 line
Kalle Valo
Re: [PATCH 05/11] rsi: handle station connection in AP mode
In reply to Arend van SprielQuoted 11 lines · Arend van Spriel
Quoted 7 lines · Prameela Rani Garnepudi
Hi Kalle,
I will change the debug level and send the updated patches again.
Thanks,
PrameelaPlease do not top-post.
Yeah, thanks. I will take care of this for all my replies from now on wards.
Quoted 36 lines
Quoted 20 lines · Kalle Valo
Quoted 18 lines
Quoted 11 lines · Amitkumar Karwar
From: Prameela Rani Garnepudi <[email protected]>
Station structures are maintained in driver with required fields. When mac80211 callback
sta_addis called, driver iterates through list of connected stations to check available index and assigns station id which is important for further communication to that station. Then peer notify frame is send to firmware to inform the firmware about new station connection.Signed-off-by Prameela Rani Garnepudi <[email protected]>Signed-off-by Amitkumar Karwar <[email protected]>[...]
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +1
-0@@ -1157,18 +1159,81 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +bool sta_exist = false;Quoted 8 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_add(struct ieee80211_hw *hw, · line 1166
Quoted 4 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +4
-0+struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station add: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );The driver should not spam the logs every time a client connects, so this should be a debug message.
Quoted 2 lines
I am wondering why
print_hex_dump()is used for printing the station mac address. Just use:pr_debug("Station add: %pM\n", sta->addr);
Yeah. Got the point, thanks. I will use 'rsi' macro 'rsi_dbg' for this debug message with this format specifier '%pM'.
Quoted 3 lines
Regards,
Arend
Signature · 1 line
G. Prameela Rani (M.Tech,CSE)
PATCH 6/11 rsi: handle station disconnection in AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
When sta_remove of mac80211 is called, driver iterates through list of existing stations to get the station id. Then peer notify is prepared and send to firmare.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 57 +++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 11 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +46 -11
@@ -1255,21 +1255,56 @@ static int rsi_mac80211_sta_remove(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +struct ieee80211_bss_conf *bss = &vif->bss_conf; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station Remove: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );mutex_lock (&common->mutex); -/* Resetting all the fields to default values */ - common->bitrate_mask[NL80211_BAND_2GHZ ] =0 ; - common->bitrate_mask[NL80211_BAND_5GHZ ] =0 ; - common->min_rate =0xffff ; - common->vif_info[0 ].is_ht = false; - common->vif_info[0 ].sgi = false; - common->vif_info[0 ].seq_start =0 ; - common->secinfo.ptk_cipher =0 ; - common->secinfo.gtk_cipher =0 ; +if (vif->type ==NL80211_IFTYPE_AP ) { +u8 sta_idx, cnt; -rsi_send_rx_filter_frame (common,0 ); - +/* Send peer notify to device */ +rsi_dbg (INFO_ZONE ,"Indicate bss status to device\n" ); +for (sta_idx =0 ; sta_idx < common->max_stations; sta_idx++) { + rsta = &common->stations[sta_idx]; + +if (!rsta->sta) +continue ; +if (!memcmp (rsta->sta->addr, sta->addr,ETH_ALEN )) { +rsi_inform_bss_status (common,AP_OPMODE ,0 , + sta->addr, sta->wme, + sta->aid, sta, sta_idx); + rsta->sta =NULL ; + rsta->sta_id =-1 ; +for (cnt =0 ; cnt <IEEE80211_NUM_TIDS ; cnt++) + rsta->start_tx_aggr[cnt] = false; +if (common->num_stations >0 ) + common->num_stations--; +break ; + } + } +if (sta_idx >= common->max_stations) +rsi_dbg (ERR_ZONE ,"%s: No station found\n" , __func__); + } + +if (vif->type ==NL80211_IFTYPE_STATION ) { +/* Resetting all the fields to default values */ +memcpy ((u8 *)bss->bssid, (u8 *)sta->addr,ETH_ALEN ); + bss->qos = sta->wme; + common->bitrate_mask[NL80211_BAND_2GHZ ] =0 ; + common->bitrate_mask[NL80211_BAND_5GHZ ] =0 ; + common->min_rate =0xffff ; + common->vif_info[0 ].is_ht = false; + common->vif_info[0 ].sgi = false; + common->vif_info[0 ].seq_start =0 ; + common->secinfo.ptk_cipher =0 ; + common->secinfo.gtk_cipher =0 ; +if (!common->iface_down) +rsi_send_rx_filter_frame (common,0 ); + }mutex_unlock (&common->mutex);return 0 ;
Signature · 1 line
2.7.4
Re: [PATCH 06/11] rsi: handle station disconnection in AP mode
Quoted 17 lines · Amitkumar Karwar
From: Prameela Rani Garnepudi <[email protected]>
When
sta_removeof mac80211 is called, driver iterates through list of existing stations to get the station id. Then peer notify is prepared and send to firmare.Signed-off-by Prameela Rani Garnepudi <[email protected]>Signed-off-by Amitkumar Karwar <[email protected]>--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 57 +++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 11 deletions(-)drivers/net/wireless/rsi/rsi_91x_mac80211.c +0
-0
drivers/net/wireless/rsi/rsi_91x_mac80211.c static int rsi_mac80211_sta_remove(struct ieee80211_hw *hw, · line 1262
Quoted 8 lines
drivers/net/wireless/rsi/rsi_91x_mac80211.c +5
-0@@ -1255,21 +1255,56 @@ static int rsi_mac80211_sta_remove(struct ieee80211_hw *hw, {struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; +struct ieee80211_bss_conf *bss = &vif->bss_conf; +struct rsi_sta *rsta; + +print_hex_dump (KERN_INFO ,"Station Remove: " ,DUMP_PREFIX_OFFSET , +16 ,1 , sta->addr,ETH_ALEN ,0 );
Same here, please convert it to a debug message.
Signature · 1 line
Kalle Valo
PATCH 7/11 rsi: data and managemet path changes for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
Station id needs to be get for data and management frames to fill in the descruptor for AP mode. Few other changes related to AP mode are covered here.
--- drivers/net/wireless/rsi/rsi_91x_core.c | 55 ++++++++++++++++++++++------ drivers/net/wireless/rsi/rsi_91x_hal.c | 64 ++++++++++++++++++++++++--------- drivers/net/wireless/rsi/rsi_common.h | 1 + drivers/net/wireless/rsi/rsi_hal.h | 2 +- drivers/net/wireless/rsi/rsi_mgmt.h | 1 + 5 files changed, 96 insertions(+), 27 deletions(-)
drivers/net/wireless/rsi/rsi_91x_core.c +45 -10
@@ -320,6 +320,20 @@ void rsi_core_qos_processor(struct rsi_common *common) } } +struct rsi_sta *rsi_find_sta (struct rsi_common *common,u8 *mac_addr) +{ +int i; + +for (i =0 ; i < common->max_stations; i++) { +if (!common->stations[i].sta) +continue ; +if (!(memcmp (common->stations[i].sta->addr, + mac_addr,ETH_ALEN ))) +return &common->stations[i]; + } +return NULL ; +} +/** * rsi_core_xmit() - This function transmits the packets received from mac80211 * @common: Pointer to the driver private structure.
@@ -332,39 +346,60 @@ void rsi_core_xmit(struct rsi_common *common, struct sk_buff *skb)struct rsi_hw *adapter = common->priv;struct ieee80211_tx_info *info;struct skb_info *tx_params; -struct ieee80211_hdr *tmp_hdr =NULL ; +struct ieee80211_hdr *wh; +struct ieee80211_vif *vif = adapter->vifs[0 ];u8 q_num, tid =0 ; +struct rsi_sta *rsta =NULL ;if ((!skb) || (!skb->len)) {rsi_dbg (ERR_ZONE ,"%s: Null skb/zero Length packet\n" , __func__); goto xmit_fail; } - info =IEEE80211_SKB_CB (skb); - tx_params = (struct skb_info *)info->driver_data; - tmp_hdr = (struct ieee80211_hdr *)&skb->data[0 ]; -if (common->fsm_state !=FSM_MAC_INIT_DONE ) {rsi_dbg (ERR_ZONE ,"%s: FSM state not open\n" , __func__); goto xmit_fail; } -if ((ieee80211_is_mgmt (tmp_hdr->frame_control)) || - (ieee80211_is_ctl (tmp_hdr->frame_control)) || - (ieee80211_is_qos_nullfunc (tmp_hdr->frame_control))) { + info =IEEE80211_SKB_CB (skb); + tx_params = (struct skb_info *)info->driver_data; + wh = (struct ieee80211_hdr *)&skb->data[0 ]; + tx_params->sta_id =0 ; + +if ((ieee80211_is_mgmt (wh->frame_control)) || + (ieee80211_is_ctl (wh->frame_control)) || + (ieee80211_is_qos_nullfunc (wh->frame_control))) { q_num =MGMT_SOFT_Q ; skb->priority = q_num; }else { -if (ieee80211_is_data_qos (tmp_hdr->frame_control)) { +if (ieee80211_is_data_qos (wh->frame_control)) { tid = (skb->data[24 ] &IEEE80211_QOS_TID ); skb->priority =TID_TO_WME_AC (tid); }else { tid =IEEE80211_NONQOS_TID ; skb->priority =BE_Q ; } + q_num = skb->priority; tx_params->tid = tid; - tx_params->sta_id =0 ; + +if ((vif->type ==NL80211_IFTYPE_AP ) && + (!is_broadcast_ether_addr (wh->addr1)) && + (!is_multicast_ether_addr (wh->addr1))) { + rsta =rsi_find_sta (common, wh->addr1); +if (!rsta) + goto xmit_fail; + tx_params->sta_id = rsta->sta_id; + } + +if (rsta) { +/* Start aggregation if not done for this tid */ +if (!rsta->start_tx_aggr[tid]) { + rsta->start_tx_aggr[tid] = true; +ieee80211_start_tx_ba_session (rsta->sta, + tid,0 ); + } + } } if ((q_num < MGMT_SOFT_Q) &&
drivers/net/wireless/rsi/rsi_91x_hal.c +48 -16
131 lines not on this page · raw message
drivers/net/wireless/rsi/rsi_common.h +1 -0
@@ -83,4 +83,5 @@ u16 rsi_get_connected_channel(struct rsi_hw *adapter);struct rsi_hw *rsi_91x_init (void );void rsi_91x_deinit (struct rsi_hw *adapter);int rsi_read_pkt (struct rsi_common *common,s32 rcv_pkt_len); +struct rsi_sta *rsi_find_sta (struct rsi_common *common,u8 *mac_addr);#endif
drivers/net/wireless/rsi/rsi_hal.h +1 -1
@@ -126,7 +126,7 @@ struct rsi_mgmt_desc {__le16 bbp_info;__le16 seq_ctrl;u8 reserved2; -u8 vap_info; +u8 sta_id; } __packed;struct rsi_data_desc {
drivers/net/wireless/rsi/rsi_mgmt.h +1 -0
@@ -63,6 +63,7 @@#define BBP_REG_WRITE 0#define RF_RESET_ENABLE BIT(3)#define RATE_INFO_ENABLE BIT(0) +#define MORE_DATA_PRESENT BIT(1)#define RSI_BROADCAST_PKT BIT(9)#define RSI_DESC_REQUIRE_CFM_TO_HOST BIT(2)#define RSI_ADD_DELTA_TSF_VAP_ID BIT(3)
Signature · 1 line
2.7.4
PATCH 8/11 rsi: use common descriptor for auto rate frame
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
TX command frame auto rate request is modified to use common descriptor struture.
--- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 18 +++++++----------- drivers/net/wireless/rsi/rsi_mgmt.h | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mgmt.c +7 -11
@@ -1164,8 +1164,9 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)u32 rate_bitmap = common->bitrate_mask[band];u16 *selected_rates, min_rate; +u16 frame_len =sizeof (struct rsi_auto_rate ); - skb =dev_alloc_skb (sizeof (struct rsi_auto_rate )); + skb =dev_alloc_skb (frame_len);if (!skb) {rsi_dbg (ERR_ZONE ,"%s: Failed in allocation of skb\n" , __func__);
@@ -1180,8 +1181,6 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)return -ENOMEM ; } -memset (skb->data,0 ,sizeof (struct rsi_auto_rate )); - auto_rate = (struct rsi_auto_rate *)skb->data; auto_rate->aarf_rssi =cpu_to_le16 (((u16 )3 <<6 ) | (u16)(18 &0x3f ));
@@ -1190,10 +1189,10 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) auto_rate->initial_boundary =cpu_to_le16 (3 ); auto_rate->max_threshold_limt =cpu_to_le16 (27 ); - auto_rate->desc_word[1 ] =cpu_to_le16 (AUTO_RATE_IND ); + auto_rate->desc.desc_dword0.frame_type =AUTO_RATE_IND ;if (common->channel_width ==BW_40MHZ ) - auto_rate->desc_word[7 ] |=cpu_to_le16 (1 ); + auto_rate->desc.desc_dword3.qid_tid =BW_40MHZ ;if (band ==NL80211_BAND_2GHZ ) { min_rate =RSI_RATE_1 ;
@@ -1259,15 +1258,12 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) auto_rate->num_supported_rates =cpu_to_le16 (num_supported_rates *2 ); auto_rate->moderate_rate_inx =cpu_to_le16 (num_supported_rates /2 ); - auto_rate->desc_word[7 ] |=cpu_to_le16 (0 <<8 ); num_supported_rates *=2 ; - auto_rate->desc_word[0 ] =cpu_to_le16 ((sizeof (*auto_rate) - -FRAME_DESC_SZ ) | - (RSI_WIFI_MGMT_Q <<12 )); +rsi_set_len_qno (&auto_rate->desc.desc_dword0.len_qno, + (frame_len -FRAME_DESC_SZ ),RSI_WIFI_MGMT_Q ); -skb_put (skb, -sizeof (struct rsi_auto_rate )); +skb_put (skb, frame_len);kfree (selected_rates);return rsi_send_internal_mgmt_frame (common, skb);
drivers/net/wireless/rsi/rsi_mgmt.h +1 -1
@@ -425,7 +425,7 @@ struct rsi_set_key { } __packed;struct rsi_auto_rate { -__le16 desc_word[8 ]; +struct rsi_cmd_desc desc;__le16 failure_limit;__le16 initial_boundary;__le16 max_threshold_limt;
Signature · 1 line
2.7.4
PATCH 9/11 rsi: update tx auto rate command frame for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
Auto rate frame is sent to firmware when a new station is connected. Station id and station's ht capabilities are updated in auto rate command frame.
--- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 44 +++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 10 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mgmt.c +34 -10
@@ -1152,8 +1152,11 @@ static bool rsi_map_rates(u16 rate, int *offset)* * Return: 0 on success, corresponding error code on failure. */ -static int rsi_send_auto_rate_request (struct rsi_common *common) +static int rsi_send_auto_rate_request (struct rsi_common *common, +struct ieee80211_sta *sta, +u16 sta_id) { +struct ieee80211_vif *vif = common->priv->vifs[0 ];struct sk_buff *skb;struct rsi_auto_rate *auto_rate;int ii =0 , jj =0 , kk =0 ;
@@ -1161,11 +1164,14 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)u8 band = hw->conf.chandef.chan->band;u8 num_supported_rates =0 ;u8 rate_table_offset, rate_offset =0 ; -u32 rate_bitmap = common->bitrate_mask[band]; - +u32 rate_bitmap;u16 *selected_rates, min_rate; +bool is_ht = false, is_sgi = false;u16 frame_len =sizeof (struct rsi_auto_rate ); +rsi_dbg (MGMT_TX_ZONE , +"%s: Sending auto rate request frame\n" , __func__); + skb =dev_alloc_skb (frame_len);if (!skb) { rsi_dbg(ERR_ZONE, "%s: Failed in allocation of skb\n",
@@ -1193,12 +1199,31 @@ static int rsi_send_auto_rate_request(struct rsi_common *common)if (common->channel_width ==BW_40MHZ ) auto_rate->desc.desc_dword3.qid_tid =BW_40MHZ ; + auto_rate->desc.desc_dword3.sta_id = sta_id; + +if (vif->type ==NL80211_IFTYPE_STATION ) { + rate_bitmap = common->bitrate_mask[band]; + is_ht = common->vif_info[0 ].is_ht; + is_sgi = common->vif_info[0 ].sgi; + }else { + rate_bitmap = sta->supp_rates[band]; + is_ht = sta->ht_cap.ht_supported; +if ((sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_20 ) || + (sta->ht_cap.cap &IEEE80211_HT_CAP_SGI_40 )) + is_sgi = true; + }if (band ==NL80211_BAND_2GHZ ) { - min_rate =RSI_RATE_1 ; +if ((rate_bitmap ==0 ) && (is_ht)) + min_rate =RSI_RATE_MCS0 ; +else + min_rate =RSI_RATE_1 ; rate_table_offset =0 ; }else { - min_rate =RSI_RATE_6 ; +if ((rate_bitmap ==0 ) && (is_ht)) + min_rate =RSI_RATE_MCS0 ; +else + min_rate =RSI_RATE_6 ; rate_table_offset =4 ; }
@@ -1212,7 +1237,7 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) } num_supported_rates = jj; -if (common->vif_info[0 ].is_ht) { +if (is_ht) {for (ii =0 ; ii <ARRAY_SIZE (mcs); ii++) selected_rates[jj++] = mcs[ii]; num_supported_rates +=ARRAY_SIZE (mcs);
@@ -1233,11 +1258,10 @@ static int rsi_send_auto_rate_request(struct rsi_common *common) }/* loading HT rates in the bottom half of the auto rate table */ -if (common->vif_info[0 ].is_ht) { +if (is_ht) {for (ii = rate_offset, kk =ARRAY_SIZE (rsi_mcsrates) -1 ; ii < rate_offset +2 *ARRAY_SIZE (rsi_mcsrates); ii++) { -if (common->vif_info[0 ].sgi || -conf_is_ht40 (&common->priv->hw->conf)) +if (is_sgi ||conf_is_ht40 (&common->priv->hw->conf)) auto_rate->supported_rates[ii++] =cpu_to_le16 (rsi_mcsrates[kk] |BIT (9 ));else
@@ -1300,7 +1324,7 @@ void rsi_inform_bss_status(struct rsi_common *common, qos_enable, aid, sta_id);if (common->min_rate ==0xffff ) -rsi_send_auto_rate_request (common); +rsi_send_auto_rate_request (common, sta, sta_id);if (opmode ==STA_OPMODE ) {if (!rsi_send_block_unblock_frame (common, false)) common->hw_data_qs_blocked = false;
Signature · 1 line
2.7.4
PATCH 10/11 rsi: aggregation parameters frame for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
TX command frame ampdu aggregation parameters is updated to include sta_id for AP mode.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 43 +++++++++++++++++++++++------ drivers/net/wireless/rsi/rsi_91x_mgmt.c | 6 ++-- drivers/net/wireless/rsi/rsi_mgmt.h | 3 +- 3 files changed, 39 insertions(+), 13 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +34 -9
@@ -866,9 +866,11 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw,int status = -EOPNOTSUPP ;struct rsi_hw *adapter = hw->priv;struct rsi_common *common = adapter->priv; -u16 seq_no =0 ; +struct rsi_sta *rsta =NULL ; +u16 seq_no =0 , seq_start =0 ;u8 ii =0 ;struct ieee80211_sta *sta = params->sta; +u8 sta_id =0 ;enum ieee80211_ampdu_mlme_action action = params->action;u16 tid = params->tid;u16 *ssn = ¶ms->ssn;
@@ -880,17 +882,31 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw, }mutex_lock (&common->mutex); -rsi_dbg (INFO_ZONE ,"%s: AMPDU action %d called\n" , __func__, action); +if (ssn !=NULL ) seq_no = *ssn; +if (vif->type ==NL80211_IFTYPE_AP ) { + rsta =rsi_find_sta (common, sta->addr); +if (!rsta) { +rsi_dbg (ERR_ZONE ,"No station mapped\n" ); +return 0 ; + } + sta_id = rsta->sta_id; + } + +rsi_dbg (INFO_ZONE , +"%s: AMPDU action tid=%d ssn=0x%x, buf_size=%d sta_id=%d\n" , + __func__, tid, seq_no, buf_size, sta_id); +switch (action) {case IEEE80211_AMPDU_RX_START : status =rsi_send_aggregation_params_frame (common, tid, seq_no, buf_size, -STA_RX_ADDBA_DONE ); +STA_RX_ADDBA_DONE , + sta_id);break ;case IEEE80211_AMPDU_RX_STOP :
@@ -898,11 +914,15 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw, tid,0 , buf_size, - STA_RX_DELBA); +STA_RX_DELBA , + sta_id);break ;case IEEE80211_AMPDU_TX_START : - common->vif_info[ii].seq_start = seq_no; +if (vif->type ==NL80211_IFTYPE_STATION ) + common->vif_info[ii].seq_start = seq_no; +else if (vif->type ==NL80211_IFTYPE_AP ) + rsta->seq_start[tid] = seq_no;ieee80211_start_tx_ba_cb_irqsafe (vif, sta->addr, tid); status =0 ;break ;
@@ -914,18 +934,23 @@ static int rsi_mac80211_ampdu_action(struct ieee80211_hw *hw, tid, seq_no, buf_size, - STA_TX_DELBA); +STA_TX_DELBA , + sta_id);if (!status)ieee80211_stop_tx_ba_cb_irqsafe (vif, sta->addr, tid);break ;case IEEE80211_AMPDU_TX_OPERATIONAL : +if (vif->type ==NL80211_IFTYPE_STATION ) + seq_start = common->vif_info[ii].seq_start; +else if (vif->type ==NL80211_IFTYPE_AP ) + seq_start = rsta->seq_start[tid]; status =rsi_send_aggregation_params_frame (common, tid, - common->vif_info[ii] - .seq_start, + seq_start, buf_size, -STA_TX_ADDBA_DONE ); +STA_TX_ADDBA_DONE , + sta_id);break ;default :
drivers/net/wireless/rsi/rsi_91x_mgmt.c +3 -3
@@ -537,11 +537,11 @@ int rsi_send_aggregation_params_frame(struct rsi_common *common,u16 tid, u16 ssn, u8 buf_size, - u8 event) + u8 event, + u8 sta_id) { struct sk_buff *skb = NULL;struct rsi_aggr_params *aggr_params; -u8 peer_id =0 ;u16 frame_len =sizeof (struct rsi_aggr_params ); skb =dev_alloc_skb (frame_len);
@@ -561,7 +561,7 @@ int rsi_send_aggregation_params_frame(struct rsi_common *common, aggr_params->desc_dword0.frame_type =AMPDU_IND ; aggr_params->aggr_params = tid &RSI_AGGR_PARAMS_TID_MASK ; - aggr_params->peer_id = peer_id; + aggr_params->peer_id = sta_id;if (event ==STA_TX_ADDBA_DONE ) { aggr_params->seq_start =cpu_to_le16 (ssn); aggr_params->baw_size =cpu_to_le16 (buf_size);
drivers/net/wireless/rsi/rsi_mgmt.h +2 -1
@@ -609,7 +609,8 @@ int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg);int rsi_set_vap_capabilities (struct rsi_common *common,enum opmode mode,u8 *mac_addr,u8 vap_id,u8 vap_status);int rsi_send_aggregation_params_frame (struct rsi_common *common,u16 tid, -u16 ssn,u8 buf_size,u8 event); +u16 ssn,u8 buf_size,u8 event, +u8 sta_id);int rsi_hal_load_key (struct rsi_common *common,u8 *data,u16 key_len,u8 key_type,u8 key_id,u32 cipher); int rsi_set_channel(struct rsi_common *common,
Signature · 1 line
2.7.4
PATCH 11/11 rsi: security enhancements for AP mode
In reply to Amitkumar KarwarFrom: Prameela Rani Garnepudi <[email protected]>
Station id should be set in load key frame configured to device. For WEP mode, key is configured once from mac80211. This key is saved and configured to device every time a station is connected.
--- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 60 +++++++++++++++++++++-------- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 10 ++++- drivers/net/wireless/rsi/rsi_main.h | 1 + drivers/net/wireless/rsi/rsi_mgmt.h | 3 +- 4 files changed, 56 insertions(+), 18 deletions(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +45 -15
@@ -758,11 +758,14 @@ static int rsi_mac80211_conf_tx(struct ieee80211_hw *hw,*/ static int rsi_hal_key_config (struct ieee80211_hw *hw,struct ieee80211_vif *vif, -struct ieee80211_key_conf *key) +struct ieee80211_key_conf *key, +struct ieee80211_sta *sta) {struct rsi_hw *adapter = hw->priv; +struct rsi_sta *rsta =NULL ;int status;u8 key_type; +s16 sta_id =0 ;if (key->flags &IEEE80211_KEY_FLAG_PAIRWISE ) key_type =RSI_PAIRWISE_KEY ;
@@ -772,23 +775,35 @@ static int rsi_hal_key_config(struct ieee80211_hw *hw,rsi_dbg (ERR_ZONE ,"%s: Cipher 0x%x key_type: %d key_len: %d\n" , __func__, key->cipher, key_type, key->keylen); -if ((key->cipher ==WLAN_CIPHER_SUITE_WEP104 ) || - (key->cipher ==WLAN_CIPHER_SUITE_WEP40 )) { - status =rsi_hal_load_key (adapter->priv, - key->key, - key->keylen, -RSI_PAIRWISE_KEY , - key->keyidx, - key->cipher); -if (status) -return status; +if (vif->type ==NL80211_IFTYPE_AP ) { +if (sta) { + rsta =rsi_find_sta (adapter->priv, sta->addr); +if (rsta) + sta_id = rsta->sta_id; + } + adapter->priv->key = key; + }else { +if ((key->cipher ==WLAN_CIPHER_SUITE_WEP104 ) || + (key->cipher ==WLAN_CIPHER_SUITE_WEP40 )) { + status =rsi_hal_load_key (adapter->priv, + key->key, + key->keylen, +RSI_PAIRWISE_KEY , + key->keyidx, + key->cipher, + sta_id); +if (status) +return status; + } } +return rsi_hal_load_key (adapter->priv, key->key, key->keylen, key_type, key->keyidx, - key->cipher); + key->cipher, + sta_id); }/**
@@ -816,7 +831,7 @@ static int rsi_mac80211_set_key(struct ieee80211_hw *hw,switch (cmd) {case SET_KEY : secinfo->security_enable = true; - status =rsi_hal_key_config (hw, vif, key); + status =rsi_hal_key_config (hw, vif, key, sta);if (status) {mutex_unlock (&common->mutex);return status;
@@ -834,10 +849,11 @@ static int rsi_mac80211_set_key(struct ieee80211_hw *hw,break ;case DISABLE_KEY : - secinfo->security_enable = false; +if (vif->type ==NL80211_IFTYPE_STATION ) + secinfo->security_enable = false;rsi_dbg (ERR_ZONE ,"%s: RSI del key\n" , __func__);memset (key,0 ,sizeof (struct ieee80211_key_conf )); - status =rsi_hal_key_config (hw, vif, key); + status =rsi_hal_key_config (hw, vif, key, sta);break ;default :
@@ -1243,6 +1259,20 @@ static int rsi_mac80211_sta_add(struct ieee80211_hw *hw,rsi_inform_bss_status (common,AP_OPMODE ,1 , sta->addr, sta->wme, sta->aid, sta, sta_idx); +if (common->key) { +struct ieee80211_key_conf *key = common->key; + +if ((key->cipher ==WLAN_CIPHER_SUITE_WEP104 ) || + (key->cipher ==WLAN_CIPHER_SUITE_WEP40 )) +rsi_hal_load_key (adapter->priv, + key->key, + key->keylen, +RSI_PAIRWISE_KEY , + key->keyidx, + key->cipher, + sta_idx); + } + common->num_stations++; } }
drivers/net/wireless/rsi/rsi_91x_mgmt.c +8 -2
@@ -715,8 +715,10 @@ int rsi_hal_load_key(struct rsi_common *common,u16 key_len, u8 key_type, u8 key_id, - u32 cipher) + u32 cipher, + s16 sta_id) { + struct ieee80211_vif *vif = common->priv->vifs[0];struct sk_buff *skb =NULL ;struct rsi_set_key *set_key;u16 key_descriptor =0 ;
@@ -734,8 +736,11 @@ int rsi_hal_load_key(struct rsi_common *common,memset (skb->data,0 , frame_len); set_key = (struct rsi_set_key *)skb->data; -if (key_type ==RSI_GROUP_KEY ) +if (key_type ==RSI_GROUP_KEY ) { key_descriptor =RSI_KEY_TYPE_BROADCAST ; +if (vif->type ==NL80211_IFTYPE_AP ) + key_descriptor |=RSI_KEY_MODE_AP ; + }if ((cipher ==WLAN_CIPHER_SUITE_WEP40 ) || (cipher ==WLAN_CIPHER_SUITE_WEP104 )) { key_id =0 ;
@@ -754,6 +759,7 @@ int rsi_hal_load_key(struct rsi_common *common, (frame_len - FRAME_DESC_SZ), RSI_WIFI_MGMT_Q); set_key->desc_dword0.frame_type =SET_KEY_REQ ; set_key->key_desc =cpu_to_le16 (key_descriptor); + set_key->sta_id = sta_id;if (data) { if ((cipher == WLAN_CIPHER_SUITE_WEP40) ||
drivers/net/wireless/rsi/rsi_main.h +1 -0
@@ -269,6 +269,7 @@ struct rsi_common {struct rsi_sta stations[RSI_MAX_ASSOC_STAS +1 ];int num_stations;int max_stations; +struct ieee80211_key_conf *key; };enum host_intf {
drivers/net/wireless/rsi/rsi_mgmt.h +2 -1
@@ -409,6 +409,7 @@ struct rsi_dynamic_s {#define RSI_WEP_KEY_104 BIT(3)#define RSI_CIPHER_WPA BIT(4)#define RSI_CIPHER_TKIP BIT(5) +#define RSI_KEY_MODE_AP BIT(7)#define RSI_PROTECT_DATA_FRAMES BIT(13)#define RSI_KEY_ID_MASK 0xC0#define RSI_KEY_ID_OFFSET 14
@@ -612,7 +613,7 @@ int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid, u16 ssn, u8 buf_size, u8 event, u8 sta_id);int rsi_hal_load_key (struct rsi_common *common,u8 *data,u16 key_len, -u8 key_type,u8 key_id,u32 cipher); +u8 key_type,u8 key_id,u32 cipher,s16 sta_id);int rsi_set_channel (struct rsi_common *common,struct ieee80211_channel *channel);int rsi_send_vap_dynamic_update (struct rsi_common *common);
Signature · 1 line
2.7.4