diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:13:00 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 12:13:00 -0700 |
commit | f063a0c0c995d010960efcc1b2ed14b99674f25c (patch) | |
tree | 106e30acd1a58b3cf9f3c15abe1de83f1919e03b /drivers/staging/ath6kl/reorder/aggr_rx_internal.h | |
parent | 3c3762957818dc902222733a8184f23102e24472 (diff) | |
parent | 5af634789c93b97cfb314a102436716be8fbc577 (diff) | |
download | op-kernel-dev-f063a0c0c995d010960efcc1b2ed14b99674f25c.zip op-kernel-dev-f063a0c0c995d010960efcc1b2ed14b99674f25c.tar.gz |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (841 commits)
Staging: brcm80211: fix usage of roundup in structures
Staging: bcm: fix up network device reference counting
Staging: keucr: fix up US_ macro change
staging: brcm80211: brcmfmac: Removed codeversion from firmware filenames.
staging: brcm80211: Remove unnecessary header files.
staging: brcm80211: Remove unnecessary includes from bcmutils.c
staging: brcm80211: Removed unnecessary pktsetprio() function.
Staging: brcm80211: remove typedefs.h
Staging: brcm80211: remove uintptr typedef usage
Staging: hv: remove struct vmbus_channel_interface
Staging: hv: remove Open from struct vmbus_channel_interface
Staging: hv: storvsc: call vmbus_open directly
Staging: hv: netvsc: call vmbus_open directly
Staging: hv: channel: export vmbus_open to modules
Staging: hv: remove Close from struct vmbus_channel_interface
Staging: hv: netvsc: call vmbus_close directly
Staging: hv: storvsc: call vmbus_close directly
Staging: hv: channel: export vmbus_close to modules
Staging: hv: remove SendPacket from struct vmbus_channel_interface
Staging: hv: storvsc: call vmbus_sendpacket directly
...
Fix up conflicts in
drivers/staging/cx25821/cx25821-audio-upstream.c
drivers/staging/cx25821/cx25821-audio.h
due to warring whitespace cleanups (neither of which were all that great)
Diffstat (limited to 'drivers/staging/ath6kl/reorder/aggr_rx_internal.h')
-rw-r--r-- | drivers/staging/ath6kl/reorder/aggr_rx_internal.h | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/drivers/staging/ath6kl/reorder/aggr_rx_internal.h b/drivers/staging/ath6kl/reorder/aggr_rx_internal.h new file mode 100644 index 0000000..5dbf8f8 --- /dev/null +++ b/drivers/staging/ath6kl/reorder/aggr_rx_internal.h @@ -0,0 +1,116 @@ +/* + * + * Copyright (c) 2004-2010 Atheros Communications Inc. + * All rights reserved. + * + * +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +// +// + * + */ + +#ifndef __AGGR_RX_INTERNAL_H__ +#define __AGGR_RX_INTERNAL_H__ + +#include "a_osapi.h" +#include "aggr_recv_api.h" + +#define AGGR_WIN_IDX(x, y) ((x) % (y)) +#define AGGR_INCR_IDX(x, y) AGGR_WIN_IDX(((x)+1), (y)) +#define AGGR_DCRM_IDX(x, y) AGGR_WIN_IDX(((x)-1), (y)) +#define IEEE80211_MAX_SEQ_NO 0xFFF +#define IEEE80211_NEXT_SEQ_NO(x) (((x) + 1) & IEEE80211_MAX_SEQ_NO) + + +#define NUM_OF_TIDS 8 +#define AGGR_SZ_DEFAULT 8 + +#define AGGR_WIN_SZ_MIN 2 +#define AGGR_WIN_SZ_MAX 8 +/* TID Window sz is double of what is negotiated. Derive TID_WINDOW_SZ from win_sz, per tid */ +#define TID_WINDOW_SZ(_x) ((_x) << 1) + +#define AGGR_NUM_OF_FREE_NETBUFS 16 + +#define AGGR_GET_RXTID_STATS(_p, _x) (&(_p->stat[(_x)])) +#define AGGR_GET_RXTID(_p, _x) (&(_p->RxTid[(_x)])) + +/* Hold q is a function of win_sz, which is negotiated per tid */ +#define HOLD_Q_SZ(_x) (TID_WINDOW_SZ((_x))*sizeof(OSBUF_HOLD_Q)) +/* AGGR_RX_TIMEOUT value is important as a (too) small value can cause frames to be + * delivered out of order and a (too) large value can cause undesirable latency in + * certain situations. */ +#define AGGR_RX_TIMEOUT 400 /* Timeout(in ms) for delivery of frames, if they are stuck */ + +typedef enum { + ALL_SEQNO = 0, + CONTIGUOUS_SEQNO = 1, +}DELIVERY_ORDER; + +typedef struct { + void *osbuf; + A_BOOL is_amsdu; + A_UINT16 seq_no; +}OSBUF_HOLD_Q; + + +#if 0 +typedef struct { + A_UINT16 seqno_st; + A_UINT16 seqno_end; +}WINDOW_SNAPSHOT; +#endif + +typedef struct { + A_BOOL aggr; /* is it ON or OFF */ + A_BOOL progress; /* TRUE when frames have arrived after a timer start */ + A_BOOL timerMon; /* TRUE if the timer started for the sake of this TID */ + A_UINT16 win_sz; /* negotiated window size */ + A_UINT16 seq_next; /* Next seq no, in current window */ + A_UINT32 hold_q_sz; /* Num of frames that can be held in hold q */ + OSBUF_HOLD_Q *hold_q; /* Hold q for re-order */ +#if 0 + WINDOW_SNAPSHOT old_win; /* Sliding window snapshot - for timeout */ +#endif + A_NETBUF_QUEUE_T q; /* q head for enqueuing frames for dispatch */ + A_MUTEX_T lock; +}RXTID; + +typedef struct { + A_UINT32 num_into_aggr; /* hitting at the input of this module */ + A_UINT32 num_dups; /* duplicate */ + A_UINT32 num_oow; /* out of window */ + A_UINT32 num_mpdu; /* single payload 802.3/802.11 frame */ + A_UINT32 num_amsdu; /* AMSDU */ + A_UINT32 num_delivered; /* frames delivered to IP stack */ + A_UINT32 num_timeouts; /* num of timeouts, during which frames delivered */ + A_UINT32 num_hole; /* frame not present, when window moved over */ + A_UINT32 num_bar; /* num of resets of seq_num, via BAR */ +}RXTID_STATS; + +typedef struct { + A_UINT8 aggr_sz; /* config value of aggregation size */ + A_UINT8 timerScheduled; + A_TIMER timer; /* timer for returning held up pkts in re-order que */ + void *dev; /* dev handle */ + RX_CALLBACK rx_fn; /* callback function to return frames; to upper layer */ + RXTID RxTid[NUM_OF_TIDS]; /* Per tid window */ + ALLOC_NETBUFS netbuf_allocator; /* OS netbuf alloc fn */ + A_NETBUF_QUEUE_T freeQ; /* pre-allocated buffers - for A_MSDU slicing */ + RXTID_STATS stat[NUM_OF_TIDS]; /* Tid based statistics */ + PACKET_LOG pkt_log; /* Log info of the packets */ +}AGGR_INFO; + +#endif /* __AGGR_RX_INTERNAL_H__ */ |