aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/rx.c')
-rw-r--r--drivers/net/wireless/libertas/rx.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index a4d0bca9ef2c..fdb0448301a0 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -1,6 +1,9 @@
1/** 1/*
2 * This file contains the handling of RX in wlan driver. 2 * This file contains the handling of RX in wlan driver.
3 */ 3 */
4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
4#include <linux/etherdevice.h> 7#include <linux/etherdevice.h>
5#include <linux/slab.h> 8#include <linux/slab.h>
6#include <linux/types.h> 9#include <linux/types.h>
@@ -40,12 +43,12 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
40 struct sk_buff *skb); 43 struct sk_buff *skb);
41 44
42/** 45/**
43 * @brief This function processes received packet and forwards it 46 * lbs_process_rxed_packet - processes received packet and forwards it
44 * to kernel/upper layer 47 * to kernel/upper layer
45 * 48 *
46 * @param priv A pointer to struct lbs_private 49 * @priv: A pointer to &struct lbs_private
47 * @param skb A pointer to skb which includes the received packet 50 * @skb: A pointer to skb which includes the received packet
48 * @return 0 or -1 51 * returns: 0 or -1
49 */ 52 */
50int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) 53int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
51{ 54{
@@ -55,7 +58,9 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
55 struct rxpd *p_rx_pd; 58 struct rxpd *p_rx_pd;
56 int hdrchop; 59 int hdrchop;
57 struct ethhdr *p_ethhdr; 60 struct ethhdr *p_ethhdr;
58 const u8 rfc1042_eth_hdr[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 }; 61 static const u8 rfc1042_eth_hdr[] = {
62 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
63 };
59 64
60 lbs_deb_enter(LBS_DEB_RX); 65 lbs_deb_enter(LBS_DEB_RX);
61 66
@@ -154,11 +159,11 @@ done:
154EXPORT_SYMBOL_GPL(lbs_process_rxed_packet); 159EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
155 160
156/** 161/**
157 * @brief This function converts Tx/Rx rates from the Marvell WLAN format 162 * convert_mv_rate_to_radiotap - converts Tx/Rx rates from Marvell WLAN format
158 * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s) 163 * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s)
159 * 164 *
160 * @param rate Input rate 165 * @rate: Input rate
161 * @return Output Rate (0 if invalid) 166 * returns: Output Rate (0 if invalid)
162 */ 167 */
163static u8 convert_mv_rate_to_radiotap(u8 rate) 168static u8 convert_mv_rate_to_radiotap(u8 rate)
164{ 169{
@@ -189,17 +194,17 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
189 case 12: /* 54 Mbps */ 194 case 12: /* 54 Mbps */
190 return 108; 195 return 108;
191 } 196 }
192 lbs_pr_alert("Invalid Marvell WLAN rate %i\n", rate); 197 pr_alert("Invalid Marvell WLAN rate %i\n", rate);
193 return 0; 198 return 0;
194} 199}
195 200
196/** 201/**
197 * @brief This function processes a received 802.11 packet and forwards it 202 * process_rxed_802_11_packet - processes a received 802.11 packet and forwards
198 * to kernel/upper layer 203 * it to kernel/upper layer
199 * 204 *
200 * @param priv A pointer to struct lbs_private 205 * @priv: A pointer to &struct lbs_private
201 * @param skb A pointer to skb which includes the received packet 206 * @skb: A pointer to skb which includes the received packet
202 * @return 0 or -1 207 * returns: 0 or -1
203 */ 208 */
204static int process_rxed_802_11_packet(struct lbs_private *priv, 209static int process_rxed_802_11_packet(struct lbs_private *priv,
205 struct sk_buff *skb) 210 struct sk_buff *skb)
@@ -246,7 +251,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
246 /* add space for the new radio header */ 251 /* add space for the new radio header */
247 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) && 252 if ((skb_headroom(skb) < sizeof(struct rx_radiotap_hdr)) &&
248 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) { 253 pskb_expand_head(skb, sizeof(struct rx_radiotap_hdr), 0, GFP_ATOMIC)) {
249 lbs_pr_alert("%s: couldn't pskb_expand_head\n", __func__); 254 netdev_alert(dev, "%s: couldn't pskb_expand_head\n", __func__);
250 ret = -ENOMEM; 255 ret = -ENOMEM;
251 kfree_skb(skb); 256 kfree_skb(skb);
252 goto done; 257 goto done;