diff options
Diffstat (limited to 'drivers/net/wireless/libertas/rx.c')
-rw-r--r-- | drivers/net/wireless/libertas/rx.c | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c index 784dae714705..a115bfa9513a 100644 --- a/drivers/net/wireless/libertas/rx.c +++ b/drivers/net/wireless/libertas/rx.c | |||
@@ -39,10 +39,10 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
39 | struct sk_buff *skb); | 39 | struct sk_buff *skb); |
40 | 40 | ||
41 | /** | 41 | /** |
42 | * @brief This function computes the avgSNR . | 42 | * @brief This function computes the avgSNR . |
43 | * | 43 | * |
44 | * @param priv A pointer to struct lbs_private structure | 44 | * @param priv A pointer to struct lbs_private structure |
45 | * @return avgSNR | 45 | * @return avgSNR |
46 | */ | 46 | */ |
47 | static u8 lbs_getavgsnr(struct lbs_private *priv) | 47 | static u8 lbs_getavgsnr(struct lbs_private *priv) |
48 | { | 48 | { |
@@ -57,10 +57,10 @@ static u8 lbs_getavgsnr(struct lbs_private *priv) | |||
57 | } | 57 | } |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * @brief This function computes the AvgNF | 60 | * @brief This function computes the AvgNF |
61 | * | 61 | * |
62 | * @param priv A pointer to struct lbs_private structure | 62 | * @param priv A pointer to struct lbs_private structure |
63 | * @return AvgNF | 63 | * @return AvgNF |
64 | */ | 64 | */ |
65 | static u8 lbs_getavgnf(struct lbs_private *priv) | 65 | static u8 lbs_getavgnf(struct lbs_private *priv) |
66 | { | 66 | { |
@@ -75,11 +75,11 @@ static u8 lbs_getavgnf(struct lbs_private *priv) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * @brief This function save the raw SNR/NF to our internel buffer | 78 | * @brief This function save the raw SNR/NF to our internel buffer |
79 | * | 79 | * |
80 | * @param priv A pointer to struct lbs_private structure | 80 | * @param priv A pointer to struct lbs_private structure |
81 | * @param prxpd A pointer to rxpd structure of received packet | 81 | * @param prxpd A pointer to rxpd structure of received packet |
82 | * @return n/a | 82 | * @return n/a |
83 | */ | 83 | */ |
84 | static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd) | 84 | static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd) |
85 | { | 85 | { |
@@ -90,15 +90,14 @@ static void lbs_save_rawSNRNF(struct lbs_private *priv, struct rxpd *p_rx_pd) | |||
90 | priv->nextSNRNF++; | 90 | priv->nextSNRNF++; |
91 | if (priv->nextSNRNF >= DEFAULT_DATA_AVG_FACTOR) | 91 | if (priv->nextSNRNF >= DEFAULT_DATA_AVG_FACTOR) |
92 | priv->nextSNRNF = 0; | 92 | priv->nextSNRNF = 0; |
93 | return; | ||
94 | } | 93 | } |
95 | 94 | ||
96 | /** | 95 | /** |
97 | * @brief This function computes the RSSI in received packet. | 96 | * @brief This function computes the RSSI in received packet. |
98 | * | 97 | * |
99 | * @param priv A pointer to struct lbs_private structure | 98 | * @param priv A pointer to struct lbs_private structure |
100 | * @param prxpd A pointer to rxpd structure of received packet | 99 | * @param prxpd A pointer to rxpd structure of received packet |
101 | * @return n/a | 100 | * @return n/a |
102 | */ | 101 | */ |
103 | static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) | 102 | static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) |
104 | { | 103 | { |
@@ -135,9 +134,9 @@ static void lbs_compute_rssi(struct lbs_private *priv, struct rxpd *p_rx_pd) | |||
135 | * @brief This function processes received packet and forwards it | 134 | * @brief This function processes received packet and forwards it |
136 | * to kernel/upper layer | 135 | * to kernel/upper layer |
137 | * | 136 | * |
138 | * @param priv A pointer to struct lbs_private | 137 | * @param priv A pointer to struct lbs_private |
139 | * @param skb A pointer to skb which includes the received packet | 138 | * @param skb A pointer to skb which includes the received packet |
140 | * @return 0 or -1 | 139 | * @return 0 or -1 |
141 | */ | 140 | */ |
142 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | 141 | int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) |
143 | { | 142 | { |
@@ -197,7 +196,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
197 | * before the snap_type. | 196 | * before the snap_type. |
198 | */ | 197 | */ |
199 | p_ethhdr = (struct ethhdr *) | 198 | p_ethhdr = (struct ethhdr *) |
200 | ((u8 *) & p_rx_pkt->eth803_hdr | 199 | ((u8 *) &p_rx_pkt->eth803_hdr |
201 | + sizeof(p_rx_pkt->eth803_hdr) + sizeof(p_rx_pkt->rfc1042_hdr) | 200 | + sizeof(p_rx_pkt->eth803_hdr) + sizeof(p_rx_pkt->rfc1042_hdr) |
202 | - sizeof(p_rx_pkt->eth803_hdr.dest_addr) | 201 | - sizeof(p_rx_pkt->eth803_hdr.dest_addr) |
203 | - sizeof(p_rx_pkt->eth803_hdr.src_addr) | 202 | - sizeof(p_rx_pkt->eth803_hdr.src_addr) |
@@ -214,7 +213,7 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) | |||
214 | hdrchop = (u8 *)p_ethhdr - (u8 *)p_rx_pd; | 213 | hdrchop = (u8 *)p_ethhdr - (u8 *)p_rx_pd; |
215 | } else { | 214 | } else { |
216 | lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", | 215 | lbs_deb_hex(LBS_DEB_RX, "RX Data: LLC/SNAP", |
217 | (u8 *) & p_rx_pkt->rfc1042_hdr, | 216 | (u8 *) &p_rx_pkt->rfc1042_hdr, |
218 | sizeof(p_rx_pkt->rfc1042_hdr)); | 217 | sizeof(p_rx_pkt->rfc1042_hdr)); |
219 | 218 | ||
220 | /* Chop off the rxpd */ | 219 | /* Chop off the rxpd */ |
@@ -255,8 +254,8 @@ EXPORT_SYMBOL_GPL(lbs_process_rxed_packet); | |||
255 | * @brief This function converts Tx/Rx rates from the Marvell WLAN format | 254 | * @brief This function converts Tx/Rx rates from the Marvell WLAN format |
256 | * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s) | 255 | * (see Table 2 in Section 3.1) to IEEE80211_RADIOTAP_RATE units (500 Kb/s) |
257 | * | 256 | * |
258 | * @param rate Input rate | 257 | * @param rate Input rate |
259 | * @return Output Rate (0 if invalid) | 258 | * @return Output Rate (0 if invalid) |
260 | */ | 259 | */ |
261 | static u8 convert_mv_rate_to_radiotap(u8 rate) | 260 | static u8 convert_mv_rate_to_radiotap(u8 rate) |
262 | { | 261 | { |
@@ -295,9 +294,9 @@ static u8 convert_mv_rate_to_radiotap(u8 rate) | |||
295 | * @brief This function processes a received 802.11 packet and forwards it | 294 | * @brief This function processes a received 802.11 packet and forwards it |
296 | * to kernel/upper layer | 295 | * to kernel/upper layer |
297 | * | 296 | * |
298 | * @param priv A pointer to struct lbs_private | 297 | * @param priv A pointer to struct lbs_private |
299 | * @param skb A pointer to skb which includes the received packet | 298 | * @param skb A pointer to skb which includes the received packet |
300 | * @return 0 or -1 | 299 | * @return 0 or -1 |
301 | */ | 300 | */ |
302 | static int process_rxed_802_11_packet(struct lbs_private *priv, | 301 | static int process_rxed_802_11_packet(struct lbs_private *priv, |
303 | struct sk_buff *skb) | 302 | struct sk_buff *skb) |
@@ -314,7 +313,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, | |||
314 | p_rx_pkt = (struct rx80211packethdr *) skb->data; | 313 | p_rx_pkt = (struct rx80211packethdr *) skb->data; |
315 | prxpd = &p_rx_pkt->rx_pd; | 314 | prxpd = &p_rx_pkt->rx_pd; |
316 | 315 | ||
317 | // lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); | 316 | /* lbs_deb_hex(LBS_DEB_RX, "RX Data: Before chop rxpd", skb->data, min(skb->len, 100)); */ |
318 | 317 | ||
319 | if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { | 318 | if (skb->len < (ETH_HLEN + 8 + sizeof(struct rxpd))) { |
320 | lbs_deb_rx("rx err: frame received with bad length\n"); | 319 | lbs_deb_rx("rx err: frame received with bad length\n"); |