Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89892
b: refs/heads/master
c: 5890529
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Feb 29, 2008
1 parent 9e263f2 commit c46f23e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c9745e5684ad75d02020bcaa31ab6d4b498e1e1
refs/heads/master: 589052904a60f00dd2cbc1d3488ee3f520a7de21
2 changes: 0 additions & 2 deletions trunk/net/mac80211/ieee80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,8 +1429,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
local->hw.queues = 1; /* default */

local->mdev = mdev;
local->rx_handlers = ieee80211_rx_handlers;
local->tx_handlers = ieee80211_tx_handlers;

local->bridge_packets = 1;

Expand Down
13 changes: 0 additions & 13 deletions trunk/net/mac80211/ieee80211_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,6 @@ struct ieee80211_tx_stored_packet {
unsigned int last_frag_rate_ctrl_probe;
};

typedef ieee80211_tx_result (*ieee80211_tx_handler)
(struct ieee80211_txrx_data *tx);

typedef ieee80211_rx_result (*ieee80211_rx_handler)
(struct ieee80211_txrx_data *rx);

struct beacon_data {
u8 *head, *tail;
int head_len, tail_len;
Expand Down Expand Up @@ -477,9 +471,6 @@ struct ieee80211_local {
* deliver multicast frames both back to wireless
* media and to the local net stack */

ieee80211_rx_handler *rx_handlers;
ieee80211_tx_handler *tx_handlers;

struct list_head interfaces;

bool sta_sw_scanning;
Expand Down Expand Up @@ -779,11 +770,7 @@ int ieee80211_if_remove(struct net_device *dev, const char *name, int id);
void ieee80211_if_free(struct net_device *dev);
void ieee80211_if_sdata_init(struct ieee80211_sub_if_data *sdata);

/* rx handling */
extern ieee80211_rx_handler ieee80211_rx_handlers[];

/* tx handling */
extern ieee80211_tx_handler ieee80211_tx_handlers[];
void ieee80211_clear_tx_pending(struct ieee80211_local *local);
void ieee80211_tx_pending(unsigned long data);
int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev);
Expand Down
80 changes: 39 additions & 41 deletions trunk/net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1448,42 +1448,6 @@ ieee80211_rx_h_mgmt(struct ieee80211_txrx_data *rx)
return RX_QUEUED;
}

static void ieee80211_invoke_rx_handlers(struct ieee80211_local *local,
ieee80211_rx_handler *handlers,
struct ieee80211_txrx_data *rx,
struct sta_info *sta)
{
ieee80211_rx_handler *handler;
ieee80211_rx_result res = RX_DROP_MONITOR;

for (handler = handlers; *handler != NULL; handler++) {
res = (*handler)(rx);

switch (res) {
case RX_CONTINUE:
continue;
case RX_DROP_UNUSABLE:
case RX_DROP_MONITOR:
I802_DEBUG_INC(local->rx_handlers_drop);
if (sta)
sta->rx_dropped++;
break;
case RX_QUEUED:
I802_DEBUG_INC(local->rx_handlers_queued);
break;
}
break;
}

switch (res) {
case RX_DROP_MONITOR:
case RX_DROP_UNUSABLE:
case RX_CONTINUE:
dev_kfree_skb(rx->skb);
break;
}
}

static void ieee80211_rx_michael_mic_report(struct net_device *dev,
struct ieee80211_hdr *hdr,
struct sta_info *sta,
Expand Down Expand Up @@ -1557,7 +1521,8 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
rx->skb = NULL;
}

ieee80211_rx_handler ieee80211_rx_handlers[] =
typedef ieee80211_rx_result (*ieee80211_rx_handler)(struct ieee80211_txrx_data *);
static ieee80211_rx_handler ieee80211_rx_handlers[] =
{
ieee80211_rx_h_if_stats,
ieee80211_rx_h_passive_scan,
Expand All @@ -1579,6 +1544,41 @@ ieee80211_rx_handler ieee80211_rx_handlers[] =
NULL
};

static void ieee80211_invoke_rx_handlers(struct ieee80211_local *local,
struct ieee80211_txrx_data *rx,
struct sta_info *sta)
{
ieee80211_rx_handler *handler;
ieee80211_rx_result res = RX_DROP_MONITOR;

for (handler = ieee80211_rx_handlers; *handler != NULL; handler++) {
res = (*handler)(rx);

switch (res) {
case RX_CONTINUE:
continue;
case RX_DROP_UNUSABLE:
case RX_DROP_MONITOR:
I802_DEBUG_INC(local->rx_handlers_drop);
if (sta)
sta->rx_dropped++;
break;
case RX_QUEUED:
I802_DEBUG_INC(local->rx_handlers_queued);
break;
}
break;
}

switch (res) {
case RX_DROP_MONITOR:
case RX_DROP_UNUSABLE:
case RX_CONTINUE:
dev_kfree_skb(rx->skb);
break;
}
}

/* main receive path */

static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata,
Expand Down Expand Up @@ -1756,17 +1756,15 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
rx.skb = skb_new;
rx.dev = prev->dev;
rx.sdata = prev;
ieee80211_invoke_rx_handlers(local, local->rx_handlers,
&rx, sta);
ieee80211_invoke_rx_handlers(local, &rx, sta);
prev = sdata;
}
if (prev) {
rx.fc = le16_to_cpu(hdr->frame_control);
rx.skb = skb;
rx.dev = prev->dev;
rx.sdata = prev;
ieee80211_invoke_rx_handlers(local, local->rx_handlers,
&rx, sta);
ieee80211_invoke_rx_handlers(local, &rx, sta);
} else
dev_kfree_skb(skb);

Expand Down
9 changes: 4 additions & 5 deletions trunk/net/mac80211/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,10 +813,9 @@ ieee80211_tx_h_load_stats(struct ieee80211_txrx_data *tx)
return TX_CONTINUE;
}

/* TODO: implement register/unregister functions for adding TX/RX handlers
* into ordered list */

ieee80211_tx_handler ieee80211_tx_handlers[] =
typedef ieee80211_tx_result (*ieee80211_tx_handler)(struct ieee80211_txrx_data *);
static ieee80211_tx_handler ieee80211_tx_handlers[] =
{
ieee80211_tx_h_check_assoc,
ieee80211_tx_h_sequence,
Expand Down Expand Up @@ -1158,7 +1157,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb,
sta = tx.sta;
tx.u.tx.channel = local->hw.conf.channel;

for (handler = local->tx_handlers; *handler != NULL;
for (handler = ieee80211_tx_handlers; *handler != NULL;
handler++) {
res = (*handler)(&tx);
if (res != TX_CONTINUE)
Expand Down Expand Up @@ -1914,7 +1913,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw,
tx.flags |= IEEE80211_TXRXD_TXPS_BUFFERED;
tx.u.tx.channel = local->hw.conf.channel;

for (handler = local->tx_handlers; *handler != NULL; handler++) {
for (handler = ieee80211_tx_handlers; *handler != NULL; handler++) {
res = (*handler)(&tx);
if (res == TX_DROP || res == TX_QUEUED)
break;
Expand Down

0 comments on commit c46f23e

Please sign in to comment.