Skip to content

Commit

Permalink
wl12xx: remove rx filtering stuff
Browse files Browse the repository at this point in the history
The new fw doesn't support rx_filtering configuration (as a
stand-alone command. the rx filtering is done automatically
according to the active role).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Aug 22, 2011
1 parent dbe25cb commit 08c1d1c
Show file tree
Hide file tree
Showing 14 changed files with 8 additions and 339 deletions.
28 changes: 0 additions & 28 deletions drivers/net/wireless/wl12xx/acx.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,34 +183,6 @@ int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl)
return ret;
}

int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter)
{
struct acx_rx_config *rx_config;
int ret;

wl1271_debug(DEBUG_ACX, "acx rx config");

rx_config = kzalloc(sizeof(*rx_config), GFP_KERNEL);
if (!rx_config) {
ret = -ENOMEM;
goto out;
}

rx_config->config_options = cpu_to_le32(config);
rx_config->filter_options = cpu_to_le32(filter);

ret = wl1271_cmd_configure(wl, ACX_RX_CFG,
rx_config, sizeof(*rx_config));
if (ret < 0) {
wl1271_warning("failed to set rx config: %d", ret);
goto out;
}

out:
kfree(rx_config);
return ret;
}

int wl1271_acx_pd_threshold(struct wl1271 *wl)
{
struct acx_packet_detection *pd;
Expand Down
118 changes: 0 additions & 118 deletions drivers/net/wireless/wl12xx/acx.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,94 +160,6 @@ struct acx_rx_msdu_lifetime {
__le32 lifetime;
} __packed;

/*
* RX Config Options Table
* Bit Definition
* === ==========
* 31:14 Reserved
* 13 Copy RX Status - when set, write three receive status words
* to top of rx'd MPDUs.
* When cleared, do not write three status words (added rev 1.5)
* 12 Reserved
* 11 RX Complete upon FCS error - when set, give rx complete
* interrupt for FCS errors, after the rx filtering, e.g. unicast
* frames not to us with FCS error will not generate an interrupt.
* 10 SSID Filter Enable - When set, the WiLink discards all beacon,
* probe request, and probe response frames with an SSID that does
* not match the SSID specified by the host in the START/JOIN
* command.
* When clear, the WiLink receives frames with any SSID.
* 9 Broadcast Filter Enable - When set, the WiLink discards all
* broadcast frames. When clear, the WiLink receives all received
* broadcast frames.
* 8:6 Reserved
* 5 BSSID Filter Enable - When set, the WiLink discards any frames
* with a BSSID that does not match the BSSID specified by the
* host.
* When clear, the WiLink receives frames from any BSSID.
* 4 MAC Addr Filter - When set, the WiLink discards any frames
* with a destination address that does not match the MAC address
* of the adaptor.
* When clear, the WiLink receives frames destined to any MAC
* address.
* 3 Promiscuous - When set, the WiLink receives all valid frames
* (i.e., all frames that pass the FCS check).
* When clear, only frames that pass the other filters specified
* are received.
* 2 FCS - When set, the WiLink includes the FCS with the received
* frame.
* When cleared, the FCS is discarded.
* 1 PLCP header - When set, write all data from baseband to frame
* buffer including PHY header.
* 0 Reserved - Always equal to 0.
*
* RX Filter Options Table
* Bit Definition
* === ==========
* 31:12 Reserved - Always equal to 0.
* 11 Association - When set, the WiLink receives all association
* related frames (association request/response, reassocation
* request/response, and disassociation). When clear, these frames
* are discarded.
* 10 Auth/De auth - When set, the WiLink receives all authentication
* and de-authentication frames. When clear, these frames are
* discarded.
* 9 Beacon - When set, the WiLink receives all beacon frames.
* When clear, these frames are discarded.
* 8 Contention Free - When set, the WiLink receives all contention
* free frames.
* When clear, these frames are discarded.
* 7 Control - When set, the WiLink receives all control frames.
* When clear, these frames are discarded.
* 6 Data - When set, the WiLink receives all data frames.
* When clear, these frames are discarded.
* 5 FCS Error - When set, the WiLink receives frames that have FCS
* errors.
* When clear, these frames are discarded.
* 4 Management - When set, the WiLink receives all management
* frames.
* When clear, these frames are discarded.
* 3 Probe Request - When set, the WiLink receives all probe request
* frames.
* When clear, these frames are discarded.
* 2 Probe Response - When set, the WiLink receives all probe
* response frames.
* When clear, these frames are discarded.
* 1 RTS/CTS/ACK - When set, the WiLink receives all RTS, CTS and ACK
* frames.
* When clear, these frames are discarded.
* 0 Rsvd Type/Sub Type - When set, the WiLink receives all frames
* that have reserved frame types and sub types as defined by the
* 802.11 specification.
* When clear, these frames are discarded.
*/
struct acx_rx_config {
struct acx_header header;

__le32 config_options;
__le32 filter_options;
} __packed;

struct acx_packet_detection {
struct acx_header header;

Expand Down Expand Up @@ -424,35 +336,6 @@ struct acx_event_mask {
__le32 high_event_mask; /* Unused */
} __packed;

#define CFG_RX_FCS BIT(2)
#define CFG_RX_ALL_GOOD BIT(3)
#define CFG_UNI_FILTER_EN BIT(4)
#define CFG_BSSID_FILTER_EN BIT(5)
#define CFG_MC_FILTER_EN BIT(6)
#define CFG_MC_ADDR0_EN BIT(7)
#define CFG_MC_ADDR1_EN BIT(8)
#define CFG_BC_REJECT_EN BIT(9)
#define CFG_SSID_FILTER_EN BIT(10)
#define CFG_RX_INT_FCS_ERROR BIT(11)
#define CFG_RX_INT_ENCRYPTED BIT(12)
#define CFG_RX_WR_RX_STATUS BIT(13)
#define CFG_RX_FILTER_NULTI BIT(14)
#define CFG_RX_RESERVE BIT(15)
#define CFG_RX_TIMESTAMP_TSF BIT(16)

#define CFG_RX_RSV_EN BIT(0)
#define CFG_RX_RCTS_ACK BIT(1)
#define CFG_RX_PRSP_EN BIT(2)
#define CFG_RX_PREQ_EN BIT(3)
#define CFG_RX_MGMT_EN BIT(4)
#define CFG_RX_FCS_ERROR BIT(5)
#define CFG_RX_DATA_EN BIT(6)
#define CFG_RX_CTL_EN BIT(7)
#define CFG_RX_CF_EN BIT(8)
#define CFG_RX_BCN_EN BIT(9)
#define CFG_RX_AUTH_EN BIT(10)
#define CFG_RX_ASSOC_EN BIT(11)

#define SCAN_PASSIVE BIT(0)
#define SCAN_5GHZ_BAND BIT(1)
#define SCAN_TRIGGERED BIT(2)
Expand Down Expand Up @@ -1342,7 +1225,6 @@ int wl1271_acx_feature_cfg(struct wl1271 *wl);
int wl1271_acx_mem_map(struct wl1271 *wl,
struct acx_header *mem_map, size_t len);
int wl1271_acx_rx_msdu_life_time(struct wl1271 *wl);
int wl1271_acx_rx_config(struct wl1271 *wl, u32 config, u32 filter);
int wl1271_acx_pd_threshold(struct wl1271 *wl);
int wl1271_acx_slot(struct wl1271 *wl, enum acx_slot_type slot_time);
int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/wl12xx/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,9 +845,6 @@ int wl1271_boot(struct wl1271 *wl)
/* Enable firmware interrupts now */
wl1271_boot_enable_interrupts(wl);

/* set the wl1271 default filters */
wl1271_set_default_filters(wl);

wl1271_event_mbox_config(wl);

out:
Expand Down
4 changes: 0 additions & 4 deletions drivers/net/wireless/wl12xx/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,6 @@ int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
for (i = 0; i < ETH_ALEN; i++)
bssid[i] = wl->bssid[ETH_ALEN - i - 1];

join->rx_config_options = cpu_to_le32(wl->rx_config);
join->rx_filter_options = cpu_to_le32(wl->rx_filter);
join->bss_type = bss_type;
join->basic_rate_set = cpu_to_le32(wl->basic_rate_set);
join->supported_rate_set = cpu_to_le32(wl->rate_set);
Expand Down Expand Up @@ -1004,8 +1002,6 @@ int wl1271_cmd_disconnect(struct wl1271 *wl)
goto out;
}

cmd->rx_config_options = cpu_to_le32(wl->rx_config);
cmd->rx_filter_options = cpu_to_le32(wl->rx_filter);
/* disconnect reason is not used in immediate disconnections */
cmd->type = DISCONNECT_IMMEDIATE;

Expand Down
3 changes: 0 additions & 3 deletions drivers/net/wireless/wl12xx/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,6 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
DRIVER_STATE_PRINT_INT(beacon_int);
DRIVER_STATE_PRINT_INT(psm_entry_retry);
DRIVER_STATE_PRINT_INT(ps_poll_failures);
DRIVER_STATE_PRINT_HEX(filters);
DRIVER_STATE_PRINT_HEX(rx_config);
DRIVER_STATE_PRINT_HEX(rx_filter);
DRIVER_STATE_PRINT_INT(power_level);
DRIVER_STATE_PRINT_INT(rssi_thold);
DRIVER_STATE_PRINT_INT(last_rssi_event);
Expand Down
12 changes: 2 additions & 10 deletions drivers/net/wireless/wl12xx/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,14 @@ static int wl1271_ap_init_templates_config(struct wl1271 *wl)
return 0;
}

static int wl1271_init_rx_config(struct wl1271 *wl, u32 config, u32 filter)
static int wl12xx_init_rx_config(struct wl1271 *wl)
{
int ret;

ret = wl1271_acx_rx_msdu_life_time(wl);
if (ret < 0)
return ret;

ret = wl1271_acx_rx_config(wl, config, filter);
if (ret < 0)
return ret;

return 0;
}

Expand Down Expand Up @@ -650,11 +646,7 @@ int wl1271_hw_init(struct wl1271 *wl)
return ret;

/* RX config */
ret = wl1271_init_rx_config(wl,
RX_CFG_PROMISCUOUS | RX_CFG_TSF,
RX_FILTER_OPTION_DEF);
/* RX_CONFIG_OPTION_ANY_DST_ANY_BSS,
RX_FILTER_OPTION_FILTER_ALL); */
ret = wl12xx_init_rx_config(wl);
if (ret < 0)
goto out_free_memmap;

Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/wl12xx/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,5 @@ int wl1271_free_hw(struct wl1271 *wl);
irqreturn_t wl1271_irq(int irq, void *data);
bool wl1271_set_block_size(struct wl1271 *wl);
int wl1271_tx_dummy_packet(struct wl1271 *wl);
void wl1271_configure_filters(struct wl1271 *wl, unsigned int filters);

#endif
62 changes: 5 additions & 57 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,6 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
wl->session_counter = 0;
wl->rate_set = CONF_TX_RATE_MASK_BASIC;
wl->vif = NULL;
wl->filters = 0;
wl1271_free_ap_keys(wl);
memset(wl->ap_hlid_map, 0, sizeof(wl->ap_hlid_map));
wl->ap_fw_ps_map = 0;
Expand Down Expand Up @@ -2037,39 +2036,6 @@ static void wl1271_op_remove_interface(struct ieee80211_hw *hw,
cancel_work_sync(&wl->recovery_work);
}

void wl1271_configure_filters(struct wl1271 *wl, unsigned int filters)
{
wl1271_set_default_filters(wl);

/* combine requested filters with current filter config */
filters = wl->filters | filters;

wl1271_debug(DEBUG_FILTERS, "RX filters set: ");

if (filters & FIF_PROMISC_IN_BSS) {
wl1271_debug(DEBUG_FILTERS, " - FIF_PROMISC_IN_BSS");
wl->rx_config &= ~CFG_UNI_FILTER_EN;
wl->rx_config |= CFG_BSSID_FILTER_EN;
}
if (filters & FIF_BCN_PRBRESP_PROMISC) {
wl1271_debug(DEBUG_FILTERS, " - FIF_BCN_PRBRESP_PROMISC");
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
wl->rx_config &= ~CFG_SSID_FILTER_EN;
}
if (filters & FIF_OTHER_BSS) {
wl1271_debug(DEBUG_FILTERS, " - FIF_OTHER_BSS");
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
}
if (filters & FIF_CONTROL) {
wl1271_debug(DEBUG_FILTERS, " - FIF_CONTROL");
wl->rx_filter |= CFG_RX_CTL_EN;
}
if (filters & FIF_FCSFAIL) {
wl1271_debug(DEBUG_FILTERS, " - FIF_FCSFAIL");
wl->rx_filter |= CFG_RX_FCS_ERROR;
}
}

static int wl1271_dummy_join(struct wl1271 *wl)
{
int ret = 0;
Expand All @@ -2079,9 +2045,6 @@ static int wl1271_dummy_join(struct wl1271 *wl)

memcpy(wl->bssid, dummy_bssid, ETH_ALEN);

/* pass through frames from all BSS */
wl1271_configure_filters(wl, FIF_OTHER_BSS);

ret = wl1271_cmd_join(wl, wl->set_bss_type);
if (ret < 0)
goto out;
Expand Down Expand Up @@ -2163,9 +2126,6 @@ static int wl1271_unjoin(struct wl1271 *wl)
wl->tx_security_last_seq_lsb = 0;
wl->tx_security_seq = 0;

/* stop filtering packets based on bssid */
wl1271_configure_filters(wl, FIF_OTHER_BSS);

out:
return ret;
}
Expand Down Expand Up @@ -2434,18 +2394,11 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,
goto out_sleep;
}

/* determine, whether supported filter values have changed */
if (changed == 0)
goto out_sleep;

/* configure filters */
wl->filters = *total;
wl1271_configure_filters(wl, 0);

/* apply configured filters */
ret = wl1271_acx_rx_config(wl, wl->rx_config, wl->rx_filter);
if (ret < 0)
goto out_sleep;
/*
* the fw doesn't provide an api to configure the filters. instead,
* the filters configuration is based on the active roles / ROC
* state.
*/

out_sleep:
wl1271_ps_elp_sleep(wl);
Expand Down Expand Up @@ -3168,9 +3121,6 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
if (ret < 0)
goto out;

/* filter out all packets not from this BSSID */
wl1271_configure_filters(wl, 0);

/* Need to update the BSSID (for filtering etc) */
do_join = true;
}
Expand Down Expand Up @@ -4363,8 +4313,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
wl->beacon_int = WL1271_DEFAULT_BEACON_INT;
wl->default_key = 0;
wl->rx_counter = 0;
wl->rx_config = WL1271_DEFAULT_STA_RX_CONFIG;
wl->rx_filter = WL1271_DEFAULT_STA_RX_FILTER;
wl->psm_entry_retry = 0;
wl->power_level = WL1271_DEFAULT_POWER_LEVEL;
wl->basic_rate_set = CONF_TX_RATE_MASK_BASIC;
Expand Down
Loading

0 comments on commit 08c1d1c

Please sign in to comment.