-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eliad Peller
authored and
Luciano Coelho
committed
Nov 27, 2012
1 parent
ab95845
commit 0b0df9c
Showing
18 changed files
with
736 additions
and
373 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: fcab189027cdd68df7f97474d1419aaa4a82130c | ||
refs/heads/master: c50a282515dc7092f7318708a0f3ae7ca7342b9f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
wl12xx-objs = main.o cmd.o acx.o debugfs.o scan.o | ||
wl12xx-objs = main.o cmd.o acx.o debugfs.o scan.o event.o | ||
|
||
obj-$(CONFIG_WL12XX) += wl12xx.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
* This file is part of wl12xx | ||
* | ||
* Copyright (C) 2012 Texas Instruments. All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#include "event.h" | ||
#include "scan.h" | ||
#include "../wlcore/cmd.h" | ||
#include "../wlcore/debug.h" | ||
|
||
int wl12xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event, | ||
bool *timeout) | ||
{ | ||
u32 local_event; | ||
|
||
switch (event) { | ||
case WLCORE_EVENT_ROLE_STOP_COMPLETE: | ||
local_event = ROLE_STOP_COMPLETE_EVENT_ID; | ||
break; | ||
|
||
case WLCORE_EVENT_PEER_REMOVE_COMPLETE: | ||
local_event = PEER_REMOVE_COMPLETE_EVENT_ID; | ||
break; | ||
|
||
default: | ||
/* event not implemented */ | ||
return 0; | ||
} | ||
return wlcore_cmd_wait_for_event_or_timeout(wl, local_event, timeout); | ||
} | ||
|
||
int wl12xx_process_mailbox_events(struct wl1271 *wl) | ||
{ | ||
struct wl12xx_event_mailbox *mbox = wl->mbox; | ||
u32 vector; | ||
|
||
|
||
vector = le32_to_cpu(mbox->events_vector); | ||
vector &= ~(le32_to_cpu(mbox->events_mask)); | ||
|
||
wl1271_debug(DEBUG_EVENT, "MBOX vector: 0x%x", vector); | ||
|
||
if (vector & SCAN_COMPLETE_EVENT_ID) { | ||
wl1271_debug(DEBUG_EVENT, "status: 0x%x", | ||
mbox->scheduled_scan_status); | ||
|
||
if (wl->scan_wlvif) | ||
wl12xx_scan_completed(wl, wl->scan_wlvif); | ||
} | ||
|
||
if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) | ||
wlcore_event_sched_scan_report(wl, | ||
mbox->scheduled_scan_status); | ||
|
||
if (vector & PERIODIC_SCAN_COMPLETE_EVENT_ID) | ||
wlcore_event_sched_scan_completed(wl, | ||
mbox->scheduled_scan_status); | ||
if (vector & SOFT_GEMINI_SENSE_EVENT_ID) | ||
wlcore_event_soft_gemini_sense(wl, | ||
mbox->soft_gemini_sense_info); | ||
|
||
if (vector & BSS_LOSE_EVENT_ID) | ||
wlcore_event_beacon_loss(wl, 0xff); | ||
|
||
if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) | ||
wlcore_event_rssi_trigger(wl, mbox->rssi_snr_trigger_metric); | ||
|
||
if (vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) | ||
wlcore_event_ba_rx_constraint(wl, | ||
BIT(mbox->role_id), | ||
mbox->rx_ba_allowed); | ||
|
||
if (vector & CHANNEL_SWITCH_COMPLETE_EVENT_ID) | ||
wlcore_event_channel_switch(wl, 0xff, | ||
mbox->channel_switch_status); | ||
|
||
if (vector & DUMMY_PACKET_EVENT_ID) | ||
wlcore_event_dummy_packet(wl); | ||
|
||
/* | ||
* "TX retries exceeded" has a different meaning according to mode. | ||
* In AP mode the offending station is disconnected. | ||
*/ | ||
if (vector & MAX_TX_RETRY_EVENT_ID) | ||
wlcore_event_max_tx_failure(wl, | ||
le16_to_cpu(mbox->sta_tx_retry_exceeded)); | ||
|
||
if (vector & INACTIVE_STA_EVENT_ID) | ||
wlcore_event_inactive_sta(wl, | ||
le16_to_cpu(mbox->sta_aging_status)); | ||
|
||
if (vector & REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID) | ||
wlcore_event_roc_complete(wl); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* | ||
* This file is part of wl12xx | ||
* | ||
* Copyright (C) 2012 Texas Instruments. All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#ifndef __WL12XX_EVENT_H__ | ||
#define __WL12XX_EVENT_H__ | ||
|
||
#include "../wlcore/wlcore.h" | ||
|
||
enum { | ||
MEASUREMENT_START_EVENT_ID = BIT(8), | ||
MEASUREMENT_COMPLETE_EVENT_ID = BIT(9), | ||
SCAN_COMPLETE_EVENT_ID = BIT(10), | ||
WFD_DISCOVERY_COMPLETE_EVENT_ID = BIT(11), | ||
AP_DISCOVERY_COMPLETE_EVENT_ID = BIT(12), | ||
RESERVED1 = BIT(13), | ||
PSPOLL_DELIVERY_FAILURE_EVENT_ID = BIT(14), | ||
ROLE_STOP_COMPLETE_EVENT_ID = BIT(15), | ||
RADAR_DETECTED_EVENT_ID = BIT(16), | ||
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), | ||
DUMMY_PACKET_EVENT_ID = BIT(21), | ||
SOFT_GEMINI_SENSE_EVENT_ID = BIT(22), | ||
CHANGE_AUTO_MODE_TIMEOUT_EVENT_ID = BIT(23), | ||
SOFT_GEMINI_AVALANCHE_EVENT_ID = BIT(24), | ||
PLT_RX_CALIBRATION_COMPLETE_EVENT_ID = BIT(25), | ||
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), | ||
}; | ||
|
||
struct wl12xx_event_mailbox { | ||
__le32 events_vector; | ||
__le32 events_mask; | ||
__le32 reserved_1; | ||
__le32 reserved_2; | ||
|
||
u8 number_of_scan_results; | ||
u8 scan_tag; | ||
u8 completed_scan_status; | ||
u8 reserved_3; | ||
|
||
u8 soft_gemini_sense_info; | ||
u8 soft_gemini_protective_info; | ||
s8 rssi_snr_trigger_metric[NUM_OF_RSSI_SNR_TRIGGERS]; | ||
u8 change_auto_mode_timeout; | ||
u8 scheduled_scan_status; | ||
u8 reserved4; | ||
/* tuned channel (roc) */ | ||
u8 roc_channel; | ||
|
||
__le16 hlid_removed_bitmap; | ||
|
||
/* bitmap of aged stations (by HLID) */ | ||
__le16 sta_aging_status; | ||
|
||
/* bitmap of stations (by HLID) which exceeded max tx retries */ | ||
__le16 sta_tx_retry_exceeded; | ||
|
||
/* 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]; | ||
|
||
/* Channel switch results */ | ||
|
||
u8 channel_switch_role_id; | ||
u8 channel_switch_status; | ||
u8 reserved_7[2]; | ||
|
||
u8 ps_poll_delivery_failure_role_ids; | ||
u8 stopped_role_ids; | ||
u8 started_role_ids; | ||
|
||
u8 reserved_8[9]; | ||
} __packed; | ||
|
||
int wl12xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event, | ||
bool *timeout); | ||
int wl12xx_process_mailbox_events(struct wl1271 *wl); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
wl18xx-objs = main.o acx.o tx.o io.o debugfs.o scan.o cmd.o | ||
wl18xx-objs = main.o acx.o tx.o io.o debugfs.o scan.o cmd.o event.o | ||
|
||
obj-$(CONFIG_WL18XX) += wl18xx.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
/* | ||
* This file is part of wl12xx | ||
* | ||
* Copyright (C) 2012 Texas Instruments. All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or | ||
* modify it under the terms of the GNU General Public License | ||
* version 2 as published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA | ||
* | ||
*/ | ||
|
||
#include "event.h" | ||
#include "scan.h" | ||
#include "../wlcore/cmd.h" | ||
#include "../wlcore/debug.h" | ||
|
||
int wl18xx_wait_for_event(struct wl1271 *wl, enum wlcore_wait_event event, | ||
bool *timeout) | ||
{ | ||
u32 local_event; | ||
|
||
switch (event) { | ||
case WLCORE_EVENT_PEER_REMOVE_COMPLETE: | ||
local_event = PEER_REMOVE_COMPLETE_EVENT_ID; | ||
break; | ||
|
||
default: | ||
/* event not implemented */ | ||
return 0; | ||
} | ||
return wlcore_cmd_wait_for_event_or_timeout(wl, local_event, timeout); | ||
} | ||
|
||
int wl18xx_process_mailbox_events(struct wl1271 *wl) | ||
{ | ||
struct wl18xx_event_mailbox *mbox = wl->mbox; | ||
u32 vector; | ||
|
||
vector = le32_to_cpu(mbox->events_vector); | ||
wl1271_debug(DEBUG_EVENT, "MBOX vector: 0x%x", vector); | ||
|
||
if (vector & SCAN_COMPLETE_EVENT_ID) { | ||
wl1271_debug(DEBUG_EVENT, "scan results: %d", | ||
mbox->number_of_scan_results); | ||
|
||
if (wl->scan_wlvif) | ||
wl18xx_scan_completed(wl, wl->scan_wlvif); | ||
} | ||
|
||
if (vector & PERIODIC_SCAN_COMPLETE_EVENT_ID) | ||
wlcore_event_sched_scan_completed(wl, 1); | ||
|
||
if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) | ||
wlcore_event_rssi_trigger(wl, mbox->rssi_snr_trigger_metric); | ||
|
||
if (vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) | ||
wlcore_event_ba_rx_constraint(wl, | ||
le16_to_cpu(mbox->rx_ba_role_id_bitmap), | ||
le16_to_cpu(mbox->rx_ba_allowed_bitmap)); | ||
|
||
if (vector & BSS_LOSS_EVENT_ID) | ||
wlcore_event_beacon_loss(wl, | ||
le16_to_cpu(mbox->bss_loss_bitmap)); | ||
|
||
if (vector & CHANNEL_SWITCH_COMPLETE_EVENT_ID) | ||
wlcore_event_channel_switch(wl, | ||
le16_to_cpu(mbox->channel_switch_role_id_bitmap), | ||
true); | ||
|
||
if (vector & DUMMY_PACKET_EVENT_ID) | ||
wlcore_event_dummy_packet(wl); | ||
|
||
/* | ||
* "TX retries exceeded" has a different meaning according to mode. | ||
* In AP mode the offending station is disconnected. | ||
*/ | ||
if (vector & MAX_TX_FAILURE_EVENT_ID) | ||
wlcore_event_max_tx_failure(wl, | ||
le32_to_cpu(mbox->tx_retry_exceeded_bitmap)); | ||
|
||
if (vector & INACTIVE_STA_EVENT_ID) | ||
wlcore_event_inactive_sta(wl, | ||
le32_to_cpu(mbox->inactive_sta_bitmap)); | ||
|
||
if (vector & REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID) | ||
wlcore_event_roc_complete(wl); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.