diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-10 00:49:26 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:06:32 -0500 |
commit | 6f93a8e7e41c2d29749242f983f41e3f6a75b40b (patch) | |
tree | 69f4acfc1ff4b7b5e94b3f8f33d9fc472da922b6 /drivers/net/wireless/libertas/rx.c | |
parent | 7bf02c2985ced746f8b8956dbe4b0384edb41846 (diff) |
libertas: kill lbs_upload_tx_packet()
It replaces two lines of code. And even for those it has to make
inferences about things (i.e. which device) which the caller would have
just known.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/rx.c')
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 141069fa67f2..6332fd451a1e 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -131,22 +131,6 @@ static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) | |||
131 | lbs_deb_leave(LBS_DEB_RX); | 131 | lbs_deb_leave(LBS_DEB_RX); |
132 | } | 132 | } |
133 | 133 | ||
134 | void lbs_upload_rx_packet(struct lbs_private *priv, struct sk_buff *skb) | ||
135 | { | ||
136 | lbs_deb_rx("skb->data %p\n", skb->data); | ||
137 | |||
138 | if (priv->monitormode != LBS_MONITOR_OFF) { | ||
139 | skb->protocol = eth_type_trans(skb, priv->rtap_net_dev); | ||
140 | } else { | ||
141 | if (priv->mesh_dev && IS_MESH_FRAME(skb)) | ||
142 | skb->protocol = eth_type_trans(skb, priv->mesh_dev); | ||
143 | else | ||
144 | skb->protocol = eth_type_trans(skb, priv->dev); | ||
145 | } | ||
146 | skb->ip_summed = CHECKSUM_NONE; | ||
147 | netif_rx(skb); | ||
148 | } | ||
149 | |||
150 | /** | 134 | /** |
151 | * @brief This function processes received packet and forwards it | 135 | * @brief This function processes received packet and forwards it |
152 | * to kernel/upper layer | 136 | * to kernel/upper layer |
@@ -158,7 +142,7 @@ void lbs_upload_rx_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
158 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | 142 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) |
159 | { | 143 | { |
160 | int ret = 0; | 144 | int ret = 0; |
161 | 145 | struct net_device *dev = priv->dev; | |
162 | struct rxpackethdr *p_rx_pkt; | 146 | struct rxpackethdr *p_rx_pkt; |
163 | struct rxpd *p_rx_pd; | 147 | struct rxpd *p_rx_pd; |
164 | 148 | ||
@@ -169,15 +153,15 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
169 | 153 | ||
170 | lbs_deb_enter(LBS_DEB_RX); | 154 | lbs_deb_enter(LBS_DEB_RX); |
171 | 155 | ||
156 | skb->ip_summed = CHECKSUM_NONE; | ||
157 | |||
172 | if (priv->monitormode != LBS_MONITOR_OFF) | 158 | if (priv->monitormode != LBS_MONITOR_OFF) |
173 | return process_rxed_802_11_packet(priv, skb); | 159 | return process_rxed_802_11_packet(priv, skb); |
174 | 160 | ||
175 | p_rx_pkt = (struct rxpackethdr *) skb->data; | 161 | p_rx_pkt = (struct rxpackethdr *) skb->data; |
176 | p_rx_pd = &p_rx_pkt->rx_pd; | 162 | p_rx_pd = &p_rx_pkt->rx_pd; |
177 | if (p_rx_pd->rx_control & RxPD_MESH_FRAME) | 163 | if (priv->mesh_dev && (p_rx_pd->rx_control & RxPD_MESH_FRAME)) |
178 | SET_MESH_FRAME(skb); | 164 | dev = priv->mesh_dev; |
179 | else | ||
180 | UNSET_MESH_FRAME(skb); | ||
181 | 165 | ||
182 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, | 166 | lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, |
183 | min_t(unsigned int, skb->len, 100)); | 167 | min_t(unsigned int, skb->len, 100)); |
@@ -262,7 +246,8 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
262 | priv->stats.rx_bytes += skb->len; | 246 | priv->stats.rx_bytes += skb->len; |
263 | priv->stats.rx_packets++; | 247 | priv->stats.rx_packets++; |
264 | 248 | ||
265 | lbs_upload_rx_packet(priv, skb); | 249 | skb->protocol = eth_type_trans(skb, dev); |
250 | netif_rx(skb); | ||
266 | 251 | ||
267 | ret = 0; | 252 | ret = 0; |
268 | done: | 253 | done: |
@@ -404,7 +389,8 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
404 | priv->stats.rx_bytes += skb->len; | 389 | priv->stats.rx_bytes += skb->len; |
405 | priv->stats.rx_packets++; | 390 | priv->stats.rx_packets++; |
406 | 391 | ||
407 | lbs_upload_rx_packet(priv, skb); | 392 | skb->protocol = eth_type_trans(skb, priv->rtap_net_dev); |
393 | netif_rx(skb); | ||
408 | 394 | ||
409 | ret = 0; | 395 | ret = 0; |
410 | 396 | ||