Commit c690ec81 authored by Eliad Peller's avatar Eliad Peller Committed by Luciano Coelho

wl12xx: update commands & events

Change the commands and events according to the new fw api
(fw >= 6/7.3.0.0.75).

The main change is the replacement of JOIN/DISCONNECT commands,
with ROLE_START/ROLE_STOP commands.

The use of these commands should be preceded by the ROLE_ENABLE
command (allocating role resources), and followed by the
ROLE_DISABLE command (freeing role resources).
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 7f097988
......@@ -494,21 +494,18 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
wl->event_mask = BSS_LOSE_EVENT_ID |
SCAN_COMPLETE_EVENT_ID |
PS_REPORT_EVENT_ID |
JOIN_EVENT_COMPLETE_ID |
DISCONNECT_EVENT_COMPLETE_ID |
RSSI_SNR_TRIGGER_0_EVENT_ID |
PSPOLL_DELIVERY_FAILURE_EVENT_ID |
SOFT_GEMINI_SENSE_EVENT_ID |
PERIODIC_SCAN_REPORT_EVENT_ID |
PERIODIC_SCAN_COMPLETE_EVENT_ID;
if (wl->bss_type == BSS_TYPE_AP_BSS)
wl->event_mask |= STA_REMOVE_COMPLETE_EVENT_ID |
PERIODIC_SCAN_COMPLETE_EVENT_ID |
DUMMY_PACKET_EVENT_ID |
PEER_REMOVE_COMPLETE_EVENT_ID |
BA_SESSION_RX_CONSTRAINT_EVENT_ID |
REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID |
INACTIVE_STA_EVENT_ID |
MAX_TX_RETRY_EVENT_ID;
else
wl->event_mask |= DUMMY_PACKET_EVENT_ID |
BA_SESSION_RX_CONSTRAINT_EVENT_ID;
ret = wl1271_event_unmask(wl);
if (ret < 0) {
......
This diff is collapsed.
This diff is collapsed.
......@@ -285,10 +285,10 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
if ((vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) && !is_ap) {
wl1271_debug(DEBUG_EVENT, "BA_SESSION_RX_CONSTRAINT_EVENT_ID. "
"ba_allowed = 0x%x", mbox->ba_allowed);
"ba_allowed = 0x%x", mbox->rx_ba_allowed);
if (wl->vif)
wl1271_stop_ba_event(wl, mbox->ba_allowed);
wl1271_stop_ba_event(wl, mbox->rx_ba_allowed);
}
if ((vector & DUMMY_PACKET_EVENT_ID) && !is_ap) {
......
......@@ -49,32 +49,27 @@ enum {
MEASUREMENT_START_EVENT_ID = BIT(8),
MEASUREMENT_COMPLETE_EVENT_ID = BIT(9),
SCAN_COMPLETE_EVENT_ID = BIT(10),
SCHEDULED_SCAN_COMPLETE_EVENT_ID = BIT(11),
WFD_DISCOVERY_COMPLETE_EVENT_ID = BIT(11),
AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12),
PS_REPORT_EVENT_ID = BIT(13),
PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14),
DISCONNECT_EVENT_COMPLETE_ID = BIT(15),
JOIN_EVENT_COMPLETE_ID = BIT(16),
/* BIT(16) is reserved */
CHANNEL_SWITCH_COMPLETE_EVENT_ID = BIT(17),
BSS_LOSE_EVENT_ID = BIT(18),
REGAINED_BSS_EVENT_ID = BIT(19),
MAX_TX_RETRY_EVENT_ID = BIT(20),
/* STA: dummy paket for dynamic mem blocks */
DUMMY_PACKET_EVENT_ID = BIT(21),
/* AP: STA remove complete */
STA_REMOVE_COMPLETE_EVENT_ID = BIT(21),
SOFT_GEMINI_SENSE_EVENT_ID = BIT(22),
/* STA: SG prediction */
SOFT_GEMINI_PREDICTION_EVENT_ID = BIT(23),
/* AP: Inactive STA */
INACTIVE_STA_EVENT_ID = BIT(23),
CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID = BIT(23),
SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24),
PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25),
DBG_EVENT_ID = BIT(26),
HEALTH_CHECK_REPLY_EVENT_ID = BIT(27),
INACTIVE_STA_EVENT_ID = BIT(26),
PEER_REMOVE_COMPLETE_EVENT_ID = BIT(27),
PERIODIC_SCAN_COMPLETE_EVENT_ID = BIT(28),
PERIODIC_SCAN_REPORT_EVENT_ID = BIT(29),
BA_SESSION_RX_CONSTRAINT_EVENT_ID = BIT(30),
REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID = BIT(31),
EVENT_MBOX_ALL_EVENT_ID = 0x7fffffff,
};
......@@ -83,15 +78,6 @@ enum {
EVENT_ENTER_POWER_SAVE_SUCCESS,
};
struct event_debug_report {
u8 debug_event_id;
u8 num_params;
__le16 pad;
__le32 report_1;
__le32 report_2;
__le32 report_3;
} __packed;
#define NUM_OF_RSSI_SNR_TRIGGERS 8
struct event_mailbox {
......@@ -100,49 +86,45 @@ struct event_mailbox {
__le32 reserved_1;
__le32 reserved_2;
u8 dbg_event_id;
u8 num_relevant_params;
__le16 reserved_3;
__le32 event_report_p1;
__le32 event_report_p2;
__le32 event_report_p3;
u8 number_of_scan_results;
u8 scan_tag;
u8 reserved_4[2];
__le32 compl_scheduled_scan_status;
u8 completed_scan_status;
u8 reserved_3;
__le16 scheduled_scan_attended_channels;
u8 soft_gemini_sense_info;
u8 soft_gemini_protective_info;
s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS];
u8 channel_switch_status;
u8 scheduled_scan_status;
u8 ps_status;
/* tuned channel (roc) */
u8 roc_channel;
/* AP FW only */
u8 hlid_removed;
__le16 hlid_removed_bitmap;
/* a bitmap of hlids for stations that have been inactive too long */
/* bitmap of aged stations (by HLID) */
__le16 sta_aging_status;
/* a bitmap of hlids for stations which didn't respond to TX */
/* bitmap of stations (by HLID) which exceeded max tx retries */
__le16 sta_tx_retry_exceeded;
/*
* Bitmap, Each bit set represents the Role ID for which this constraint
* is set. Range: 0 - FF, FF means ANY role
*/
u8 ba_role_id;
/*
* Bitmap, Each bit set represents the Link ID for which this constraint
* is set. Not applicable if ba_role_id is set to ANY role (FF).
* Range: 0 - FFFF, FFFF means ANY link in that role
*/
u8 ba_link_id;
u8 ba_allowed;
/* discovery completed results */
u8 discovery_tag;
u8 number_of_preq_results;
u8 number_of_prsp_results;
u8 reserved_5;
/* rx ba constraint */
u8 role_id; /* 0xFF means any role. */
u8 rx_ba_allowed;
u8 reserved_6[2];
u8 ps_poll_delivery_failure_role_ids;
u8 stopped_role_ids;
u8 started_role_ids;
u8 change_auto_mode_timeout;
u8 reserved_5[21];
u8 reserved_7[12];
} __packed;
int wl1271_event_unmask(struct wl1271 *wl);
......
......@@ -404,12 +404,6 @@ static int wl1271_sta_hw_init_post_mem(struct wl1271 *wl)
{
int ret, i;
ret = wl1271_cmd_set_sta_default_wep_key(wl, wl->default_key);
if (ret < 0) {
wl1271_warning("couldn't set default key");
return ret;
}
/* disable all keep-alive templates */
for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
ret = wl1271_acx_keep_alive_config(wl, i,
......
......@@ -415,7 +415,7 @@ static int wl1271_check_operstate(struct wl1271 *wl, unsigned char operstate)
if (test_and_set_bit(WL1271_FLAG_STA_STATE_SENT, &wl->flags))
return 0;
ret = wl1271_cmd_set_sta_state(wl);
ret = wl12xx_cmd_set_peer_state(wl);
if (ret < 0)
return ret;
......@@ -1982,6 +1982,8 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
wl->ap_ps_map = 0;
wl->sched_scanning = false;
wl->role_id = WL12XX_INVALID_ROLE_ID;
memset(wl->roles_map, 0, sizeof(wl->roles_map));
memset(wl->links_map, 0, sizeof(wl->links_map));
/*
* this is performed after the cancel_work calls and the associated
......@@ -2030,7 +2032,7 @@ static int wl1271_dummy_join(struct wl1271 *wl)
memcpy(wl->bssid, dummy_bssid, ETH_ALEN);
ret = wl1271_cmd_join(wl, wl->set_bss_type);
ret = wl12xx_cmd_role_start_sta(wl);
if (ret < 0)
goto out;
......@@ -2059,7 +2061,7 @@ static int wl1271_join(struct wl1271 *wl, bool set_assoc)
if (set_assoc)
set_bit(WL1271_FLAG_STA_ASSOCIATED, &wl->flags);
ret = wl1271_cmd_join(wl, wl->set_bss_type);
ret = wl12xx_cmd_role_start_sta(wl);
if (ret < 0)
goto out;
......@@ -2100,7 +2102,7 @@ static int wl1271_unjoin(struct wl1271 *wl)
int ret;
/* to stop listening to a channel, we disconnect */
ret = wl1271_cmd_disconnect(wl);
ret = wl12xx_cmd_role_stop_sta(wl);
if (ret < 0)
goto out;
......@@ -2472,7 +2474,8 @@ static int wl1271_ap_init_hwenc(struct wl1271 *wl)
}
if (wep_key_added) {
ret = wl1271_cmd_set_ap_default_wep_key(wl, wl->default_key);
ret = wl12xx_cmd_set_default_wep_key(wl, wl->default_key,
WL1271_AP_BROADCAST_HLID);
if (ret < 0)
goto out;
}
......@@ -2550,8 +2553,9 @@ static int wl1271_set_key(struct wl1271 *wl, u16 action, u8 id, u8 key_type,
/* the default WEP key needs to be configured at least once */
if (key_type == KEY_WEP) {
ret = wl1271_cmd_set_sta_default_wep_key(wl,
wl->default_key);
ret = wl12xx_cmd_set_default_wep_key(wl,
wl->default_key,
wl->sta_hlid);
if (ret < 0)
return ret;
}
......@@ -3008,7 +3012,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
if ((changed & BSS_CHANGED_BEACON_ENABLED)) {
if (bss_conf->enable_beacon) {
if (!test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
ret = wl1271_cmd_start_bss(wl);
ret = wl12xx_cmd_role_start_ap(wl);
if (ret < 0)
goto out;
......@@ -3021,7 +3025,7 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
}
} else {
if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
ret = wl1271_cmd_stop_bss(wl);
ret = wl12xx_cmd_role_stop_ap(wl);
if (ret < 0)
goto out;
......@@ -3532,7 +3536,7 @@ static int wl1271_op_sta_add(struct ieee80211_hw *hw,
if (ret < 0)
goto out_free_sta;
ret = wl1271_cmd_add_sta(wl, sta, hlid);
ret = wl12xx_cmd_add_peer(wl, sta, hlid);
if (ret < 0)
goto out_sleep;
......@@ -3575,7 +3579,7 @@ static int wl1271_op_sta_remove(struct ieee80211_hw *hw,
if (ret < 0)
goto out;
ret = wl1271_cmd_remove_sta(wl, wl_sta->hlid);
ret = wl12xx_cmd_remove_peer(wl, wl_sta->hlid);
if (ret < 0)
goto out_sleep;
......
......@@ -37,9 +37,10 @@ static int wl1271_set_default_wep_key(struct wl1271 *wl, u8 id)
bool is_ap = (wl->bss_type == BSS_TYPE_AP_BSS);
if (is_ap)
ret = wl1271_cmd_set_ap_default_wep_key(wl, id);
ret = wl12xx_cmd_set_default_wep_key(wl, id,
WL1271_AP_BROADCAST_HLID);
else
ret = wl1271_cmd_set_sta_default_wep_key(wl, id);
ret = wl12xx_cmd_set_default_wep_key(wl, id, wl->sta_hlid);
if (ret < 0)
return ret;
......
......@@ -137,6 +137,7 @@ extern u32 wl12xx_debug_level;
#define WL1271_DEFAULT_BEACON_INT 100
#define WL1271_DEFAULT_DTIM_PERIOD 1
#define WL12XX_MAX_ROLES 4
#define WL12XX_MAX_LINKS 8
#define WL12XX_INVALID_ROLE_ID 0xff
#define WL12XX_INVALID_LINK_ID 0xff
......@@ -394,6 +395,10 @@ struct wl1271 {
int channel;
u8 role_id;
u8 sta_hlid;
u8 dev_hlid;
unsigned long links_map[BITS_TO_LONGS(WL12XX_MAX_LINKS)];
unsigned long roles_map[BITS_TO_LONGS(WL12XX_MAX_ROLES)];
struct wl1271_acx_mem_map *target_mem_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment