aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/rx.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-11-15 18:05:47 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:04:46 -0500
commit1007832103d016d1563fab71d4cf2b057a0bcceb (patch)
tree3b5080b01bee6e1f98cc9489382c534e963ac748 /drivers/net/wireless/libertas/rx.c
parent9a62f73b1a3bbd35a6f84fcd6636e672b09981ec (diff)
libertas: move to uniform lbs_/LBS_ namespace
This patch unifies the namespace of variables, functions defines and structures. It does: - rename libertas_XXX to lbs_XXX - rename LIBERTAS_XXX to lbs_XXX - rename wlan_XXX to lbs_XXX - rename WLAN_XXX to LBS_XXX (but only those that were defined in libertas-local *.h files, e.g. not defines from net/ieee80211.h) While passing, I fixed some checkpatch.pl errors too. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> 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.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/wireless/libertas/rx.c b/drivers/net/wireless/libertas/rx.c
index 0420e5b9ff9b..204955904340 100644
--- a/drivers/net/wireless/libertas/rx.c
+++ b/drivers/net/wireless/libertas/rx.c
@@ -35,19 +35,19 @@ struct rx80211packethdr {
35 void *eth80211_hdr; 35 void *eth80211_hdr;
36} __attribute__ ((packed)); 36} __attribute__ ((packed));
37 37
38static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb); 38static int process_rxed_802_11_packet(lbs_private *priv, struct sk_buff *skb);
39 39
40/** 40/**
41 * @brief This function computes the avgSNR . 41 * @brief This function computes the avgSNR .
42 * 42 *
43 * @param priv A pointer to wlan_private structure 43 * @param priv A pointer to lbs_private structure
44 * @return avgSNR 44 * @return avgSNR
45 */ 45 */
46static u8 wlan_getavgsnr(wlan_private * priv) 46static u8 lbs_getavgsnr(lbs_private *priv)
47{ 47{
48 u8 i; 48 u8 i;
49 u16 temp = 0; 49 u16 temp = 0;
50 wlan_adapter *adapter = priv->adapter; 50 lbs_adapter *adapter = priv->adapter;
51 if (adapter->numSNRNF == 0) 51 if (adapter->numSNRNF == 0)
52 return 0; 52 return 0;
53 for (i = 0; i < adapter->numSNRNF; i++) 53 for (i = 0; i < adapter->numSNRNF; i++)
@@ -59,14 +59,14 @@ static u8 wlan_getavgsnr(wlan_private * priv)
59/** 59/**
60 * @brief This function computes the AvgNF 60 * @brief This function computes the AvgNF
61 * 61 *
62 * @param priv A pointer to wlan_private structure 62 * @param priv A pointer to lbs_private structure
63 * @return AvgNF 63 * @return AvgNF
64 */ 64 */
65static u8 wlan_getavgnf(wlan_private * priv) 65static u8 lbs_getavgnf(lbs_private *priv)
66{ 66{
67 u8 i; 67 u8 i;
68 u16 temp = 0; 68 u16 temp = 0;
69 wlan_adapter *adapter = priv->adapter; 69 lbs_adapter *adapter = priv->adapter;
70 if (adapter->numSNRNF == 0) 70 if (adapter->numSNRNF == 0)
71 return 0; 71 return 0;
72 for (i = 0; i < adapter->numSNRNF; i++) 72 for (i = 0; i < adapter->numSNRNF; i++)
@@ -78,13 +78,13 @@ static u8 wlan_getavgnf(wlan_private * priv)
78/** 78/**
79 * @brief This function save the raw SNR/NF to our internel buffer 79 * @brief This function save the raw SNR/NF to our internel buffer
80 * 80 *
81 * @param priv A pointer to wlan_private structure 81 * @param priv A pointer to lbs_private structure
82 * @param prxpd A pointer to rxpd structure of received packet 82 * @param prxpd A pointer to rxpd structure of received packet
83 * @return n/a 83 * @return n/a
84 */ 84 */
85static void wlan_save_rawSNRNF(wlan_private * priv, struct rxpd *p_rx_pd) 85static void lbs_save_rawSNRNF(lbs_private *priv, struct rxpd *p_rx_pd)
86{ 86{
87 wlan_adapter *adapter = priv->adapter; 87 lbs_adapter *adapter = priv->adapter;
88 if (adapter->numSNRNF < DEFAULT_DATA_AVG_FACTOR) 88 if (adapter->numSNRNF < DEFAULT_DATA_AVG_FACTOR)
89 adapter->numSNRNF++; 89 adapter->numSNRNF++;
90 adapter->rawSNR[adapter->nextSNRNF] = p_rx_pd->snr; 90 adapter->rawSNR[adapter->nextSNRNF] = p_rx_pd->snr;
@@ -98,13 +98,13 @@ static void wlan_save_rawSNRNF(wlan_private * priv, struct rxpd *p_rx_pd)
98/** 98/**
99 * @brief This function computes the RSSI in received packet. 99 * @brief This function computes the RSSI in received packet.
100 * 100 *
101 * @param priv A pointer to wlan_private structure 101 * @param priv A pointer to lbs_private structure
102 * @param prxpd A pointer to rxpd structure of received packet 102 * @param prxpd A pointer to rxpd structure of received packet
103 * @return n/a 103 * @return n/a
104 */ 104 */
105static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd) 105static void lbs_compute_rssi(lbs_private *priv, struct rxpd *p_rx_pd)
106{ 106{
107 wlan_adapter *adapter = priv->adapter; 107 lbs_adapter *adapter = priv->adapter;
108 108
109 lbs_deb_enter(LBS_DEB_RX); 109 lbs_deb_enter(LBS_DEB_RX);
110 110
@@ -115,10 +115,10 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
115 115
116 adapter->SNR[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->snr; 116 adapter->SNR[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->snr;
117 adapter->NF[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->nf; 117 adapter->NF[TYPE_RXPD][TYPE_NOAVG] = p_rx_pd->nf;
118 wlan_save_rawSNRNF(priv, p_rx_pd); 118 lbs_save_rawSNRNF(priv, p_rx_pd);
119 119
120 adapter->SNR[TYPE_RXPD][TYPE_AVG] = wlan_getavgsnr(priv) * AVG_SCALE; 120 adapter->SNR[TYPE_RXPD][TYPE_AVG] = lbs_getavgsnr(priv) * AVG_SCALE;
121 adapter->NF[TYPE_RXPD][TYPE_AVG] = wlan_getavgnf(priv) * AVG_SCALE; 121 adapter->NF[TYPE_RXPD][TYPE_AVG] = lbs_getavgnf(priv) * AVG_SCALE;
122 lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n", 122 lbs_deb_rx("after computing SNR: SNR-avg = %d, NF-avg = %d\n",
123 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE, 123 adapter->SNR[TYPE_RXPD][TYPE_AVG] / AVG_SCALE,
124 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE); 124 adapter->NF[TYPE_RXPD][TYPE_AVG] / AVG_SCALE);
@@ -134,11 +134,11 @@ static void wlan_compute_rssi(wlan_private * priv, struct rxpd *p_rx_pd)
134 lbs_deb_leave(LBS_DEB_RX); 134 lbs_deb_leave(LBS_DEB_RX);
135} 135}
136 136
137void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb) 137void lbs_upload_rx_packet(lbs_private *priv, struct sk_buff *skb)
138{ 138{
139 lbs_deb_rx("skb->data %p\n", skb->data); 139 lbs_deb_rx("skb->data %p\n", skb->data);
140 140
141 if (priv->adapter->monitormode != WLAN_MONITOR_OFF) { 141 if (priv->adapter->monitormode != LBS_MONITOR_OFF) {
142 skb->protocol = eth_type_trans(skb, priv->rtap_net_dev); 142 skb->protocol = eth_type_trans(skb, priv->rtap_net_dev);
143 } else { 143 } else {
144 if (priv->mesh_dev && IS_MESH_FRAME(skb)) 144 if (priv->mesh_dev && IS_MESH_FRAME(skb))
@@ -154,13 +154,13 @@ void libertas_upload_rx_packet(wlan_private * priv, struct sk_buff *skb)
154 * @brief This function processes received packet and forwards it 154 * @brief This function processes received packet and forwards it
155 * to kernel/upper layer 155 * to kernel/upper layer
156 * 156 *
157 * @param priv A pointer to wlan_private 157 * @param priv A pointer to lbs_private
158 * @param skb A pointer to skb which includes the received packet 158 * @param skb A pointer to skb which includes the received packet
159 * @return 0 or -1 159 * @return 0 or -1
160 */ 160 */
161int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb) 161int lbs_process_rxed_packet(lbs_private *priv, struct sk_buff *skb)
162{ 162{
163 wlan_adapter *adapter = priv->adapter; 163 lbs_adapter *adapter = priv->adapter;
164 int ret = 0; 164 int ret = 0;
165 165
166 struct rxpackethdr *p_rx_pkt; 166 struct rxpackethdr *p_rx_pkt;
@@ -173,7 +173,7 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
173 173
174 lbs_deb_enter(LBS_DEB_RX); 174 lbs_deb_enter(LBS_DEB_RX);
175 175
176 if (priv->adapter->monitormode != WLAN_MONITOR_OFF) 176 if (priv->adapter->monitormode != LBS_MONITOR_OFF)
177 return process_rxed_802_11_packet(priv, skb); 177 return process_rxed_802_11_packet(priv, skb);
178 178
179 p_rx_pkt = (struct rxpackethdr *) skb->data; 179 p_rx_pkt = (struct rxpackethdr *) skb->data;
@@ -258,22 +258,22 @@ int libertas_process_rxed_packet(wlan_private * priv, struct sk_buff *skb)
258 * only if the rate is auto 258 * only if the rate is auto
259 */ 259 */
260 if (adapter->auto_rate) 260 if (adapter->auto_rate)
261 adapter->cur_rate = libertas_fw_index_to_data_rate(p_rx_pd->rx_rate); 261 adapter->cur_rate = lbs_fw_index_to_data_rate(p_rx_pd->rx_rate);
262 262
263 wlan_compute_rssi(priv, p_rx_pd); 263 lbs_compute_rssi(priv, p_rx_pd);
264 264
265 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); 265 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
266 priv->stats.rx_bytes += skb->len; 266 priv->stats.rx_bytes += skb->len;
267 priv->stats.rx_packets++; 267 priv->stats.rx_packets++;
268 268
269 libertas_upload_rx_packet(priv, skb); 269 lbs_upload_rx_packet(priv, skb);
270 270
271 ret = 0; 271 ret = 0;
272done: 272done:
273 lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret); 273 lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
274 return ret; 274 return ret;
275} 275}
276EXPORT_SYMBOL_GPL(libertas_process_rxed_packet); 276EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
277 277
278/** 278/**
279 * @brief This function converts Tx/Rx rates from the Marvell WLAN format 279 * @brief This function converts Tx/Rx rates from the Marvell WLAN format
@@ -319,13 +319,13 @@ static u8 convert_mv_rate_to_radiotap(u8 rate)
319 * @brief This function processes a received 802.11 packet and forwards it 319 * @brief This function processes a received 802.11 packet and forwards it
320 * to kernel/upper layer 320 * to kernel/upper layer
321 * 321 *
322 * @param priv A pointer to wlan_private 322 * @param priv A pointer to lbs_private
323 * @param skb A pointer to skb which includes the received packet 323 * @param skb A pointer to skb which includes the received packet
324 * @return 0 or -1 324 * @return 0 or -1
325 */ 325 */
326static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb) 326static int process_rxed_802_11_packet(lbs_private *priv, struct sk_buff *skb)
327{ 327{
328 wlan_adapter *adapter = priv->adapter; 328 lbs_adapter *adapter = priv->adapter;
329 int ret = 0; 329 int ret = 0;
330 330
331 struct rx80211packethdr *p_rx_pkt; 331 struct rx80211packethdr *p_rx_pkt;
@@ -359,7 +359,7 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
359 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd)); 359 skb->len, sizeof(struct rxpd), skb->len - sizeof(struct rxpd));
360 360
361 /* create the exported radio header */ 361 /* create the exported radio header */
362 if(priv->adapter->monitormode == WLAN_MONITOR_OFF) { 362 if (priv->adapter->monitormode == LBS_MONITOR_OFF) {
363 /* no radio header */ 363 /* no radio header */
364 /* chop the rxpd */ 364 /* chop the rxpd */
365 skb_pull(skb, sizeof(struct rxpd)); 365 skb_pull(skb, sizeof(struct rxpd));
@@ -409,15 +409,15 @@ static int process_rxed_802_11_packet(wlan_private * priv, struct sk_buff *skb)
409 * only if the rate is auto 409 * only if the rate is auto
410 */ 410 */
411 if (adapter->auto_rate) 411 if (adapter->auto_rate)
412 adapter->cur_rate = libertas_fw_index_to_data_rate(prxpd->rx_rate); 412 adapter->cur_rate = lbs_fw_index_to_data_rate(prxpd->rx_rate);
413 413
414 wlan_compute_rssi(priv, prxpd); 414 lbs_compute_rssi(priv, prxpd);
415 415
416 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len); 416 lbs_deb_rx("rx data: size of actual packet %d\n", skb->len);
417 priv->stats.rx_bytes += skb->len; 417 priv->stats.rx_bytes += skb->len;
418 priv->stats.rx_packets++; 418 priv->stats.rx_packets++;
419 419
420 libertas_upload_rx_packet(priv, skb); 420 lbs_upload_rx_packet(priv, skb);
421 421
422 ret = 0; 422 ret = 0;
423 423