~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/staging/rtl8192e/ieee80211/rtl819x_BAProc.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/********************************************************************************************************************************
2
 
 * This file is created to process BA Action Frame. According to 802.11 spec, there are 3 BA action types at all. And as BA is
3
 
 * related to TS, this part need some struture defined in QOS side code. Also TX RX is going to be resturctured, so how to send
4
 
 * ADDBAREQ ADDBARSP and DELBA packet is still on consideration. Temporarily use MANAGE QUEUE instead of Normal Queue.
5
 
 * WB 2008-05-27
6
 
 * *****************************************************************************************************************************/
 
1
/*
 
2
 * This file is created to process BA Action Frame. According to 802.11 spec,
 
3
 * there are 3 BA action types at all. And as BA is related to TS, this part
 
4
 * need some struture defined in QOS side code. Also TX RX is going to be
 
5
 * resturctured, so how to send ADDBAREQ ADDBARSP and DELBA packet is still
 
6
 * on consideration. Temporarily use MANAGE QUEUE instead of Normal Queue.
 
7
 */
7
8
#include "ieee80211.h"
8
9
#include "rtl819x_BA.h"
9
10
 
10
 
/********************************************************************************************************************
11
 
 *function:  Activate BA entry. And if Time is nozero, start timer.
12
 
 *   input:  PBA_RECORD                 pBA  //BA entry to be enabled
13
 
 *           u16                        Time //indicate time delay.
14
 
 *  output:  none
15
 
********************************************************************************************************************/
 
11
/*
 
12
 * Activate BA entry. And if Time is nozero, start timer.
 
13
 */
16
14
void ActivateBAEntry(struct ieee80211_device* ieee, PBA_RECORD pBA, u16 Time)
17
15
{
18
16
        pBA->bValid = true;
20
18
                mod_timer(&pBA->Timer, jiffies + MSECS(Time));
21
19
}
22
20
 
23
 
/********************************************************************************************************************
24
 
 *function:  deactivate BA entry, including its timer.
25
 
 *   input:  PBA_RECORD                 pBA  //BA entry to be disabled
26
 
 *  output:  none
27
 
********************************************************************************************************************/
 
21
/*
 
22
 * deactivate BA entry, including its timer.
 
23
 */
28
24
void DeActivateBAEntry( struct ieee80211_device* ieee, PBA_RECORD pBA)
29
25
{
30
26
        pBA->bValid = false;
31
27
        del_timer_sync(&pBA->Timer);
32
28
}
33
 
/********************************************************************************************************************
34
 
 *function: deactivete BA entry in Tx Ts, and send DELBA.
35
 
 *   input:
36
 
 *           PTX_TS_RECORD              pTxTs //Tx Ts which is to deactivate BA entry.
37
 
 *  output:  none
38
 
 *  notice:  As PTX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME
39
 
********************************************************************************************************************/
 
29
 
 
30
/*
 
31
 * deactivete BA entry in Tx Ts, and send DELBA.
 
32
 */
40
33
u8 TxTsDeleteBA( struct ieee80211_device* ieee, PTX_TS_RECORD   pTxTs)
41
34
{
42
35
        PBA_RECORD              pAdmittedBa = &pTxTs->TxAdmittedBARecord;  //These two BA entries must exist in TS structure
60
53
        return bSendDELBA;
61
54
}
62
55
 
63
 
/********************************************************************************************************************
64
 
 *function: deactivete BA entry in Tx Ts, and send DELBA.
65
 
 *   input:
66
 
 *           PRX_TS_RECORD              pRxTs //Rx Ts which is to deactivate BA entry.
67
 
 *  output:  none
68
 
 *  notice:  As PRX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME, same with above
69
 
********************************************************************************************************************/
 
56
/*
 
57
 * deactivete BA entry in Tx Ts, and send DELBA.
 
58
 */
70
59
u8 RxTsDeleteBA( struct ieee80211_device* ieee, PRX_TS_RECORD   pRxTs)
71
60
{
72
61
        PBA_RECORD              pBa = &pRxTs->RxAdmittedBARecord;
81
70
        return bSendDELBA;
82
71
}
83
72
 
84
 
/********************************************************************************************************************
85
 
 *function: reset BA entry
86
 
 *   input:
87
 
 *           PBA_RECORD         pBA //entry to be reset
88
 
 *  output:  none
89
 
********************************************************************************************************************/
 
73
/*
 
74
 * reset BA entry
 
75
 */
90
76
void ResetBaEntry( PBA_RECORD pBA)
91
77
{
92
78
        pBA->bValid                     = false;
95
81
        pBA->DialogToken                = 0;
96
82
        pBA->BaStartSeqCtrl.ShortData   = 0;
97
83
}
98
 
//These functions need porting here or not?
99
 
/*******************************************************************************************************************************
100
 
 *function:  construct ADDBAREQ and ADDBARSP frame here together.
101
 
 *   input:  u8*                Dst     //ADDBA frame's destination
102
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA.
103
 
 *           u16                StatusCode  //status code in RSP and I will use it to indicate whether it's RSP or REQ(will I?)
104
 
 *           u8                 type    //indicate whether it's RSP(ACT_ADDBARSP) ow REQ(ACT_ADDBAREQ)
105
 
 *  output:  none
106
 
 *  return:  sk_buff*           skb     //return constructed skb to xmit
107
 
*******************************************************************************************************************************/
 
84
 
 
85
/*
 
86
 * construct ADDBAREQ and ADDBARSP frame here together.
 
87
 * return constructed skb to xmit
 
88
 */
108
89
static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, PBA_RECORD pBA, u16 StatusCode, u8 type)
109
90
{
110
91
        struct sk_buff *skb = NULL;
174
155
        //return NULL;
175
156
}
176
157
 
177
 
#if 0 //I try to merge ADDBA_REQ and ADDBA_RSP frames together..
178
 
/********************************************************************************************************************
179
 
 *function:  construct ADDBAREQ frame
180
 
 *   input:  u8*                dst     //ADDBARsp frame's destination
181
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA_RSP.
182
 
 *           u16                StatusCode  //status code.
183
 
 *  output:  none
184
 
 *  return:  sk_buff*           skb     //return constructed skb to xmit
185
 
********************************************************************************************************************/
186
 
static struct sk_buff* ieee80211_ADDBA_Rsp( IN  struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode)
187
 
{
188
 
        OCTET_STRING    osADDBAFrame, tmp;
189
 
 
190
 
        FillOctetString(osADDBAFrame, Buffer, 0);
191
 
        *pLength = 0;
192
 
 
193
 
        ConstructMaFrameHdr(
194
 
                                        Adapter,
195
 
                                        Addr,
196
 
                                        ACT_CAT_BA,
197
 
                                        ACT_ADDBARSP,
198
 
                                        &osADDBAFrame   );
199
 
 
200
 
        // Dialog Token
201
 
        FillOctetString(tmp, &pBA->DialogToken, 1);
202
 
        PacketAppendData(&osADDBAFrame, tmp);
203
 
 
204
 
        // Status Code
205
 
        FillOctetString(tmp, &StatusCode, 2);
206
 
        PacketAppendData(&osADDBAFrame, tmp);
207
 
 
208
 
        // BA Parameter Set
209
 
        FillOctetString(tmp, &pBA->BaParamSet, 2);
210
 
        PacketAppendData(&osADDBAFrame, tmp);
211
 
 
212
 
        // BA Timeout Value
213
 
        FillOctetString(tmp, &pBA->BaTimeoutValue, 2);
214
 
        PacketAppendData(&osADDBAFrame, tmp);
215
 
 
216
 
        *pLength = osADDBAFrame.Length;
217
 
}
218
 
#endif
219
 
 
220
 
/********************************************************************************************************************
221
 
 *function:  construct DELBA frame
222
 
 *   input:  u8*                dst     //DELBA frame's destination
223
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA
224
 
 *           TR_SELECT          TxRxSelect  //TX RX direction
225
 
 *           u16                ReasonCode  //status code.
226
 
 *  output:  none
227
 
 *  return:  sk_buff*           skb     //return constructed skb to xmit
228
 
********************************************************************************************************************/
 
158
/*
 
159
 * construct DELBA frame
 
160
 */
229
161
static struct sk_buff* ieee80211_DELBA(
230
162
        struct ieee80211_device* ieee,
231
163
        u8*                      dst,
286
218
        return skb;
287
219
}
288
220
 
289
 
/********************************************************************************************************************
290
 
 *function: send ADDBAReq frame out
291
 
 *   input:  u8*                dst     //ADDBAReq frame's destination
292
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA
293
 
 *  output:  none
294
 
 *  notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
295
 
********************************************************************************************************************/
 
221
/*
 
222
 * send ADDBAReq frame out
 
223
 * If any possible, please hide pBA in ieee.
 
224
 * And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
 
225
 */
296
226
void ieee80211_send_ADDBAReq(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA)
297
227
{
298
228
        struct sk_buff *skb = NULL;
309
239
        {
310
240
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__);
311
241
        }
312
 
        return;
313
242
}
314
243
 
315
 
/********************************************************************************************************************
316
 
 *function: send ADDBARSP frame out
317
 
 *   input:  u8*                dst     //DELBA frame's destination
318
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA
319
 
 *           u16                StatusCode //RSP StatusCode
320
 
 *  output:  none
321
 
 *  notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
322
 
********************************************************************************************************************/
 
244
/*
 
245
 * send ADDBARSP frame out
 
246
 *  If any possible, please hide pBA in ieee.
 
247
 * And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
 
248
 */
323
249
void ieee80211_send_ADDBARsp(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, u16 StatusCode)
324
250
{
325
251
        struct sk_buff *skb = NULL;
333
259
        {
334
260
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function %s()\n", __FUNCTION__);
335
261
        }
336
 
 
337
 
        return;
338
 
 
339
262
}
340
 
/********************************************************************************************************************
341
 
 *function: send ADDBARSP frame out
342
 
 *   input:  u8*                dst     //DELBA frame's destination
343
 
 *           PBA_RECORD         pBA     //BA_RECORD entry which stores the necessary information for BA
344
 
 *           TR_SELECT          TxRxSelect //TX or RX
345
 
 *           u16                ReasonCode //DEL ReasonCode
346
 
 *  output:  none
347
 
 *  notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
348
 
********************************************************************************************************************/
349
263
 
 
264
/*
 
265
 * send ADDBARSP frame out
 
266
 * If any possible, please hide pBA in ieee.
 
267
 * And temporarily use Manage Queue as softmac_mgmt_xmit() usually does
 
268
 */
350
269
void ieee80211_send_DELBA(struct ieee80211_device* ieee, u8* dst, PBA_RECORD pBA, TR_SELECT TxRxSelect, u16 ReasonCode)
351
270
{
352
271
        struct sk_buff *skb = NULL;
363
282
        return ;
364
283
}
365
284
 
366
 
/********************************************************************************************************************
367
 
 *function: RX ADDBAReq
368
 
 *   input:  struct sk_buff *   skb     //incoming ADDBAReq skb.
369
 
 *  return:  0(pass), other(fail)
370
 
 *  notice:  As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support.
371
 
********************************************************************************************************************/
372
285
int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb)
373
286
{
374
287
         struct ieee80211_hdr_3addr* req = NULL;
440
353
        pBA->BaTimeoutValue = *pBaTimeoutVal;
441
354
        pBA->BaStartSeqCtrl = *pBaStartSeqCtrl;
442
355
        //for half N mode we only aggregate 1 frame
443
 
        if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))
 
356
        if (ieee->GetHalfNmodeSupportByAPsHandler(ieee))
444
357
        pBA->BaParamSet.field.BufferSize = 1;
445
358
        else
446
359
        pBA->BaParamSet.field.BufferSize = 32;
463
376
 
464
377
}
465
378
 
466
 
/********************************************************************************************************************
467
 
 *function: RX ADDBARSP
468
 
 *   input:  struct sk_buff *   skb     //incoming ADDBAReq skb.
469
 
 *  return:  0(pass), other(fail)
470
 
 *  notice:  As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support.
471
 
********************************************************************************************************************/
472
379
int ieee80211_rx_ADDBARsp( struct ieee80211_device* ieee, struct sk_buff *skb)
473
380
{
474
381
         struct ieee80211_hdr_3addr* rsp = NULL;
596
503
 
597
504
}
598
505
 
599
 
/********************************************************************************************************************
600
 
 *function: RX DELBA
601
 
 *   input:  struct sk_buff *   skb     //incoming ADDBAReq skb.
602
 
 *  return:  0(pass), other(fail)
603
 
 *  notice:  As this function need support of QOS, I comment some code out. And when qos is ready, this code need to be support.
604
 
********************************************************************************************************************/
605
506
int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb)
606
507
{
607
508
         struct ieee80211_hdr_3addr* delba = NULL;
673
574
        return 0;
674
575
}
675
576
 
676
 
//
677
 
// ADDBA initiate. This can only be called by TX side.
678
 
//
 
577
/* ADDBA initiate. This can only be called by TX side. */
679
578
void
680
579
TsInitAddBA(
681
580
        struct ieee80211_device* ieee,
734
633
                                DELBA_REASON_END_BA     );
735
634
        }
736
635
}
737
 
/********************************************************************************************************************
738
 
 *function:  BA setup timer
739
 
 *   input:  unsigned long       data           //acturally we send TX_TS_RECORD or RX_TS_RECORD to these timer
740
 
 *  return:  NULL
741
 
 *  notice:
742
 
********************************************************************************************************************/
 
636
 
 
637
/*
 
638
 *  BA setup timer
 
639
 *  acturally we send TX_TS_RECORD or RX_TS_RECORD to these timer
 
640
 */
743
641
void BaSetupTimeOut(unsigned long data)
744
642
{
745
643
        PTX_TS_RECORD   pTxTs = (PTX_TS_RECORD)data;
774
672
                &pRxTs->RxAdmittedBARecord,
775
673
                RX_DIR,
776
674
                DELBA_REASON_TIMEOUT);
777
 
        return ;
778
675
}
779
676