From Anon Ymous:

Port of the otus driver from OpenBSD.  This driver supports USB 2.0
wireless network devices based on Atheros Communications AR9001U
chipset.  It claims to support several AR9001U based adapters, but has
only been tested with a NetGear WNDA3100 adapter (0x0846/0x9010).

XXX: The EDCA support is currently missing from our network stack
(hopefully coming soon), but the driver hooks for it are there.
This commit is contained in:
christos 2010-11-03 20:03:02 +00:00
parent 7ab9ff9cb8
commit 958efcff99
4 changed files with 1541 additions and 1119 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
/* $NetBSD: if_otusreg.h,v 1.2 2010/11/03 20:03:02 christos Exp $ */
/* $OpenBSD: if_otusreg.h,v 1.6 2009/04/06 18:17:01 damien Exp $ */
/*-
@ -28,7 +29,7 @@
#define AR_FW_DOWNLOAD_COMPLETE 0x31
/* Maximum number of writes that can fit in a single FW command is 7. */
#define AR_MAX_WRITE_IDX 6 /* 56 bytes */
#define AR_FW_MAX_WRITES 7 /* 56 bytes */
#define AR_FW_INIT_ADDR 0x102800
#define AR_FW_MAIN_ADDR 0x200000
@ -286,385 +287,6 @@ struct ar_evt_tx_comp {
#define AR_TX_STATUS_FAILED 2
} __packed;
/* List of supported channels. */
static const uint8_t ar_chans[] = {
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124,
128, 132, 136, 140, 149, 153, 157, 161, 165, 34, 38, 42, 46
};
/*
* This data is automatically generated from the "otus.ini" file.
* It is stored in a different way though, to reduce kernel's .rodata
* section overhead (5.1KB instead of 8.5KB).
*/
/* NB: apply AR_PHY(). */
static const uint16_t ar5416_phy_regs[] = {
0x000, 0x001, 0x002, 0x003, 0x004, 0x005, 0x006, 0x007, 0x008,
0x009, 0x00a, 0x00b, 0x00c, 0x00d, 0x00e, 0x00f, 0x010, 0x011,
0x012, 0x013, 0x014, 0x015, 0x016, 0x017, 0x018, 0x01a, 0x01b,
0x040, 0x041, 0x042, 0x043, 0x045, 0x046, 0x047, 0x048, 0x049,
0x04a, 0x04b, 0x04d, 0x04e, 0x04f, 0x051, 0x052, 0x053, 0x055,
0x056, 0x058, 0x059, 0x05c, 0x05d, 0x05e, 0x05f, 0x060, 0x061,
0x062, 0x063, 0x064, 0x065, 0x066, 0x067, 0x068, 0x069, 0x06a,
0x06b, 0x06c, 0x06d, 0x070, 0x071, 0x072, 0x073, 0x074, 0x075,
0x076, 0x077, 0x078, 0x079, 0x07a, 0x07b, 0x07c, 0x07f, 0x080,
0x081, 0x082, 0x083, 0x084, 0x085, 0x086, 0x087, 0x088, 0x089,
0x08a, 0x08b, 0x08c, 0x08d, 0x08e, 0x08f, 0x090, 0x091, 0x092,
0x093, 0x094, 0x095, 0x096, 0x097, 0x098, 0x099, 0x09a, 0x09b,
0x09c, 0x09d, 0x09e, 0x09f, 0x0a0, 0x0a1, 0x0a2, 0x0a3, 0x0a4,
0x0a5, 0x0a6, 0x0a7, 0x0a8, 0x0a9, 0x0aa, 0x0ab, 0x0ac, 0x0ad,
0x0ae, 0x0af, 0x0b0, 0x0b1, 0x0b2, 0x0b3, 0x0b4, 0x0b5, 0x0b6,
0x0b7, 0x0b8, 0x0b9, 0x0ba, 0x0bb, 0x0bc, 0x0bd, 0x0be, 0x0bf,
0x0c0, 0x0c1, 0x0c2, 0x0c3, 0x0c4, 0x0c5, 0x0c6, 0x0c7, 0x0c8,
0x0c9, 0x0ca, 0x0cb, 0x0cc, 0x0cd, 0x0ce, 0x0cf, 0x0d0, 0x0d1,
0x0d2, 0x0d3, 0x0d4, 0x0d5, 0x0d6, 0x0d7, 0x0d8, 0x0d9, 0x0da,
0x0db, 0x0dc, 0x0dd, 0x0de, 0x0df, 0x0e0, 0x0e1, 0x0e2, 0x0e3,
0x0e4, 0x0e5, 0x0e6, 0x0e7, 0x0e8, 0x0e9, 0x0ea, 0x0eb, 0x0ec,
0x0ed, 0x0ee, 0x0ef, 0x0f0, 0x0f1, 0x0f2, 0x0f3, 0x0f4, 0x0f5,
0x0f6, 0x0f7, 0x0f8, 0x0f9, 0x0fa, 0x0fb, 0x0fc, 0x0fd, 0x0fe,
0x0ff, 0x100, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109,
0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x13c, 0x13d, 0x13e,
0x13f, 0x280, 0x281, 0x282, 0x283, 0x284, 0x285, 0x286, 0x287,
0x288, 0x289, 0x28a, 0x28b, 0x28c, 0x28d, 0x28e, 0x28f, 0x290,
0x291, 0x292, 0x293, 0x294, 0x295, 0x296, 0x297, 0x298, 0x299,
0x29a, 0x29b, 0x29d, 0x29e, 0x29f, 0x2c0, 0x2c1, 0x2c2, 0x2c3,
0x2c4, 0x2c5, 0x2c6, 0x2c7, 0x2c8, 0x2c9, 0x2ca, 0x2cb, 0x2cc,
0x2cd, 0x2ce, 0x2cf, 0x2d0, 0x2d1, 0x2d2, 0x2d3, 0x2d4, 0x2d5,
0x2d6, 0x2e2, 0x2e3, 0x2e4, 0x2e5, 0x2e6, 0x2e7, 0x2e8, 0x2e9,
0x2ea, 0x2eb, 0x2ec, 0x2ed, 0x2ee, 0x2ef, 0x2f0, 0x2f1, 0x2f2,
0x2f3, 0x2f4, 0x2f5, 0x2f6, 0x2f7, 0x2f8, 0x412, 0x448, 0x458,
0x683, 0x69b, 0x812, 0x848, 0x858, 0xa83, 0xa9b, 0xc19, 0xc57,
0xc5a, 0xc6f, 0xe9c, 0xed7, 0xed8, 0xed9, 0xeda, 0xedb, 0xedc,
0xedd, 0xede, 0xedf, 0xee0, 0xee1
};
static const uint32_t ar5416_phy_vals_5ghz_20mhz[] = {
0x00000007, 0x00000300, 0x00000000, 0xad848e19, 0x7d14e000,
0x9c0a9f6b, 0x00000090, 0x00000000, 0x02020200, 0x00000e0e,
0x0a020001, 0x0000a000, 0x00000000, 0x00000e0e, 0x00000007,
0x00200400, 0x206a002e, 0x1372161e, 0x001a6a65, 0x1284233c,
0x6c48b4e4, 0x00000859, 0x7ec80d2e, 0x31395c5e, 0x0004dd10,
0x409a4190, 0x050cb081, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x000007d0, 0x00000118, 0x10000fff, 0x0510081c,
0xd0058a15, 0x00000001, 0x00000004, 0x3f3f3f3f, 0x3f3f3f3f,
0x0000007f, 0xdfb81020, 0x9280b212, 0x00020028, 0x5d50e188,
0x00081fff, 0x00009b40, 0x00001120, 0x190fb515, 0x00000000,
0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000007, 0x001fff00, 0x006f00c4, 0x03051000,
0x00000820, 0x038919be, 0x06336f77, 0x60f6532c, 0x08f186c8,
0x00046384, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
0x64646464, 0x3c787878, 0x000000aa, 0x00000000, 0x00001042,
0x00000000, 0x00000040, 0x00000080, 0x000001a1, 0x000001e1,
0x00000021, 0x00000061, 0x00000168, 0x000001a8, 0x000001e8,
0x00000028, 0x00000068, 0x00000189, 0x000001c9, 0x00000009,
0x00000049, 0x00000089, 0x00000170, 0x000001b0, 0x000001f0,
0x00000030, 0x00000070, 0x00000191, 0x000001d1, 0x00000011,
0x00000051, 0x00000091, 0x000001b8, 0x000001f8, 0x00000038,
0x00000078, 0x00000199, 0x000001d9, 0x00000019, 0x00000059,
0x00000099, 0x000000d9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x00000000,
0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005,
0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c,
0x0000000d, 0x00000010, 0x00000011, 0x00000012, 0x00000013,
0x00000014, 0x00000015, 0x00000018, 0x00000019, 0x0000001a,
0x0000001b, 0x0000001c, 0x0000001d, 0x00000020, 0x00000021,
0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000028,
0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000010, 0x0000001a, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000008, 0x00000440, 0xd6be4788, 0x012e8160,
0x40806333, 0x00106c10, 0x009c4060, 0x1883800a, 0x018830c6,
0x00000400, 0x000009b5, 0x00000000, 0x00000108, 0x3f3f3f3f,
0x3f3f3f3f, 0x13c889af, 0x38490a20, 0x00007bb6, 0x0fff3ffc,
0x00000001, 0x0000a000, 0x00000000, 0x0cc75380, 0x0f0f0f01,
0xdfa91f01, 0x00418a11, 0x00000000, 0x09249126, 0x0a1a9caa,
0x1ce739ce, 0x051701ce, 0x18010000, 0x30032602, 0x48073e06,
0x560b4c0a, 0x641a600f, 0x7a4f6e1b, 0x8c5b7e5a, 0x9d0f96cf,
0xb51fa69f, 0xcb3fbd07, 0x0000d7bf, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x3fffffff, 0x3fffffff, 0x3fffffff, 0x0003ffff, 0x79a8aa1f,
0x08000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x1ce739ce, 0x000001ce,
0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f,
0x00000000, 0x1ce739ce, 0x000000c0, 0x00180a65, 0x0510001c,
0x00009b40, 0x012e8160, 0x09249126, 0x00180a65, 0x0510001c,
0x00009b40, 0x012e8160, 0x09249126, 0x0001c600, 0x004b6a8e,
0x000003ce, 0x00181400, 0x00820820, 0x066c420f, 0x0f282207,
0x17601685, 0x1f801104, 0x37a00c03, 0x3fc40883, 0x57c00803,
0x5fd80682, 0x7fe00482, 0x7f3c7bba, 0xf3307ff0
};
#ifdef notyet
static const uint32_t ar5416_phy_vals_5ghz_40mhz[] = {
0x00000007, 0x000003c4, 0x00000000, 0xad848e19, 0x7d14e000,
0x9c0a9f6b, 0x00000090, 0x00000000, 0x02020200, 0x00000e0e,
0x0a020001, 0x0000a000, 0x00000000, 0x00000e0e, 0x00000007,
0x00200400, 0x206a002e, 0x13721c1e, 0x001a6a65, 0x1284233c,
0x6c48b4e4, 0x00000859, 0x7ec80d2e, 0x31395c5e, 0x0004dd10,
0x409a4190, 0x050cb081, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x000007d0, 0x00000230, 0x10000fff, 0x0510081c,
0xd0058a15, 0x00000001, 0x00000004, 0x3f3f3f3f, 0x3f3f3f3f,
0x0000007f, 0xdfb81020, 0x9280b212, 0x00020028, 0x5d50e188,
0x00081fff, 0x00009b40, 0x00001120, 0x190fb515, 0x00000000,
0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000007, 0x001fff00, 0x006f00c4, 0x03051000,
0x00000820, 0x038919be, 0x06336f77, 0x60f6532c, 0x08f186c8,
0x00046384, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
0x64646464, 0x3c787878, 0x000000aa, 0x00000000, 0x00001042,
0x00000000, 0x00000040, 0x00000080, 0x000001a1, 0x000001e1,
0x00000021, 0x00000061, 0x00000168, 0x000001a8, 0x000001e8,
0x00000028, 0x00000068, 0x00000189, 0x000001c9, 0x00000009,
0x00000049, 0x00000089, 0x00000170, 0x000001b0, 0x000001f0,
0x00000030, 0x00000070, 0x00000191, 0x000001d1, 0x00000011,
0x00000051, 0x00000091, 0x000001b8, 0x000001f8, 0x00000038,
0x00000078, 0x00000199, 0x000001d9, 0x00000019, 0x00000059,
0x00000099, 0x000000d9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x00000000,
0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005,
0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c,
0x0000000d, 0x00000010, 0x00000011, 0x00000012, 0x00000013,
0x00000014, 0x00000015, 0x00000018, 0x00000019, 0x0000001a,
0x0000001b, 0x0000001c, 0x0000001d, 0x00000020, 0x00000021,
0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000028,
0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000010, 0x0000001a, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000008, 0x00000440, 0xd6be4788, 0x012e8160,
0x40806333, 0x00106c10, 0x009c4060, 0x1883800a, 0x018830c6,
0x00000400, 0x000009b5, 0x00000000, 0x00000210, 0x3f3f3f3f,
0x3f3f3f3f, 0x13c889af, 0x38490a20, 0x00007bb6, 0x0fff3ffc,
0x00000001, 0x0000a000, 0x00000000, 0x0cc75380, 0x0f0f0f01,
0xdfa91f01, 0x00418a11, 0x00000000, 0x09249126, 0x0a1a9caa,
0x1ce739ce, 0x051701ce, 0x18010000, 0x30032602, 0x48073e06,
0x560b4c0a, 0x641a600f, 0x7a4f6e1b, 0x8c5b7e5a, 0x9d0f96cf,
0xb51fa69f, 0xcb3fbcbf, 0x0000d7bf, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x3fffffff, 0x3fffffff, 0x3fffffff, 0x0003ffff, 0x79a8aa1f,
0x08000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x1ce739ce, 0x000001ce,
0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f,
0x00000000, 0x1ce739ce, 0x000000c0, 0x00180a65, 0x0510001c,
0x00009b40, 0x012e8160, 0x09249126, 0x00180a65, 0x0510001c,
0x00009b40, 0x012e8160, 0x09249126, 0x0001c600, 0x004b6a8e,
0x000003ce, 0x00181400, 0x00820820, 0x066c420f, 0x0f282207,
0x17601685, 0x1f801104, 0x37a00c03, 0x3fc40883, 0x57c00803,
0x5fd80682, 0x7fe00482, 0x7f3c7bba, 0xf3307ff0
};
#endif
#ifdef notyet
static const uint32_t ar5416_phy_vals_2ghz_40mhz[] = {
0x00000007, 0x000003c4, 0x00000000, 0xad848e19, 0x7d14e000,
0x9c0a9f6b, 0x00000090, 0x00000000, 0x02020200, 0x00000e0e,
0x0a020001, 0x0000a000, 0x00000000, 0x00000e0e, 0x00000007,
0x00200400, 0x206a002e, 0x13721c24, 0x00197a68, 0x1284233c,
0x6c48b0e4, 0x00000859, 0x7ec80d2e, 0x31395c5e, 0x0004dd20,
0x409a4190, 0x050cb081, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000898, 0x00000268, 0x10000fff, 0x0510001c,
0xd0058a15, 0x00000001, 0x00000004, 0x3f3f3f3f, 0x3f3f3f3f,
0x0000007f, 0xdfb81020, 0x9280b212, 0x00020028, 0x5d50e188,
0x00081fff, 0x00009b40, 0x00001120, 0x190fb515, 0x00000000,
0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000007, 0x001fff00, 0x006f00c4, 0x03051000,
0x00000820, 0x038919be, 0x06336f77, 0x60f6532c, 0x08f186c8,
0x00046384, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
0x64646464, 0x3c787878, 0x000000aa, 0x00000000, 0x00001042,
0x00000000, 0x00000040, 0x00000080, 0x00000141, 0x00000181,
0x000001c1, 0x00000001, 0x00000041, 0x000001a8, 0x000001e8,
0x00000028, 0x00000068, 0x000000a8, 0x00000169, 0x000001a9,
0x000001e9, 0x00000029, 0x00000069, 0x00000190, 0x000001d0,
0x00000010, 0x00000050, 0x00000090, 0x00000151, 0x00000191,
0x000001d1, 0x00000011, 0x00000051, 0x00000198, 0x000001d8,
0x00000018, 0x00000058, 0x00000098, 0x00000159, 0x00000199,
0x000001d9, 0x00000019, 0x00000059, 0x00000099, 0x000000d9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x00000000,
0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005,
0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c,
0x0000000d, 0x00000010, 0x00000011, 0x00000012, 0x00000013,
0x00000014, 0x00000015, 0x00000018, 0x00000019, 0x0000001a,
0x0000001b, 0x0000001c, 0x0000001d, 0x00000020, 0x00000021,
0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000028,
0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000010, 0x0000001a, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x0000000e, 0x00000440, 0xd03e4788, 0x012a8160,
0x40806333, 0x00106c10, 0x009c4060, 0x1883800a, 0x018830c6,
0x00000400, 0x000009b5, 0x00000000, 0x00000210, 0x3f3f3f3f,
0x3f3f3f3f, 0x13c889af, 0x38490a20, 0x00007bb6, 0x0fff3ffc,
0x00000001, 0x0000a000, 0x00000000, 0x0cc75380, 0x0f0f0f01,
0xdfa91f01, 0x00418a11, 0x00000000, 0x09249126, 0x0a1a7caa,
0x1ce739ce, 0x051701ce, 0x18010000, 0x2e032402, 0x4a0a3c06,
0x621a540b, 0x764f6c1b, 0x845b7a5a, 0x950f8ccf, 0xa5cf9b4f,
0xbddfaf1f, 0xd1ffc93f, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x3fffffff, 0x3fffffff, 0x3fffffff, 0x0003ffff, 0x79a8aa1f,
0x08000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x1ce739ce, 0x000001ce,
0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f,
0x00000000, 0x1ce739ce, 0x000000c0, 0x00180a68, 0x0510001c,
0x00009b40, 0x012a8160, 0x09249126, 0x00180a68, 0x0510001c,
0x00009b40, 0x012a8160, 0x09249126, 0x0001c600, 0x004b6a8e,
0x000003ce, 0x00181400, 0x00820820, 0x066c420f, 0x0f282207,
0x17601685, 0x1f801104, 0x37a00c03, 0x3fc40883, 0x57c00803,
0x5fd80682, 0x7fe00482, 0x7f3c7bba, 0xf3307ff0
};
#endif
static const uint32_t ar5416_phy_vals_2ghz_20mhz[] = {
0x00000007, 0x00000300, 0x00000000, 0xad848e19, 0x7d14e000,
0x9c0a9f6b, 0x00000090, 0x00000000, 0x02020200, 0x00000e0e,
0x0a020001, 0x0000a000, 0x00000000, 0x00000e0e, 0x00000007,
0x00200400, 0x206a002e, 0x137216a4, 0x00197a68, 0x1284233c,
0x6c48b0e4, 0x00000859, 0x7ec80d2e, 0x31395c5e, 0x0004dd20,
0x409a4190, 0x050cb081, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000898, 0x00000134, 0x10000fff, 0x0510001c,
0xd0058a15, 0x00000001, 0x00000004, 0x3f3f3f3f, 0x3f3f3f3f,
0x0000007f, 0xdfb81020, 0x9280b212, 0x00020028, 0x5d50e188,
0x00081fff, 0x00009b40, 0x00001120, 0x190fb515, 0x00000000,
0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000007, 0x001fff00, 0x006f00c4, 0x03051000,
0x00000820, 0x038919be, 0x06336f77, 0x60f6532c, 0x08f186c8,
0x00046384, 0x00000000, 0x00000000, 0x00000000, 0x00000200,
0x64646464, 0x3c787878, 0x000000aa, 0x00000000, 0x00001042,
0x00000000, 0x00000040, 0x00000080, 0x00000141, 0x00000181,
0x000001c1, 0x00000001, 0x00000041, 0x000001a8, 0x000001e8,
0x00000028, 0x00000068, 0x000000a8, 0x00000169, 0x000001a9,
0x000001e9, 0x00000029, 0x00000069, 0x00000190, 0x000001d0,
0x00000010, 0x00000050, 0x00000090, 0x00000151, 0x00000191,
0x000001d1, 0x00000011, 0x00000051, 0x00000198, 0x000001d8,
0x00000018, 0x00000058, 0x00000098, 0x00000159, 0x00000199,
0x000001d9, 0x00000019, 0x00000059, 0x00000099, 0x000000d9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9,
0x000000f9, 0x000000f9, 0x000000f9, 0x000000f9, 0x00000000,
0x00000001, 0x00000002, 0x00000003, 0x00000004, 0x00000005,
0x00000008, 0x00000009, 0x0000000a, 0x0000000b, 0x0000000c,
0x0000000d, 0x00000010, 0x00000011, 0x00000012, 0x00000013,
0x00000014, 0x00000015, 0x00000018, 0x00000019, 0x0000001a,
0x0000001b, 0x0000001c, 0x0000001d, 0x00000020, 0x00000021,
0x00000022, 0x00000023, 0x00000024, 0x00000025, 0x00000028,
0x00000029, 0x0000002a, 0x0000002b, 0x0000002c, 0x0000002d,
0x00000030, 0x00000031, 0x00000032, 0x00000033, 0x00000034,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000035, 0x00000035, 0x00000035, 0x00000035,
0x00000035, 0x00000010, 0x0000001a, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x0000000e, 0x00000440, 0xd03e4788, 0x012a8160,
0x40806333, 0x00106c10, 0x009c4060, 0x1883800a, 0x018830c6,
0x00000400, 0x000009b5, 0x00000000, 0x00000108, 0x3f3f3f3f,
0x3f3f3f3f, 0x13c889af, 0x38490a20, 0x00007bb6, 0x0fff3ffc,
0x00000001, 0x0000a000, 0x00000000, 0x0cc75380, 0x0f0f0f01,
0xdfa91f01, 0x00418a11, 0x00000000, 0x09249126, 0x0a1a7caa,
0x1ce739ce, 0x051701ce, 0x18010000, 0x2e032402, 0x4a0a3c06,
0x621a540b, 0x764f6c1b, 0x845b7a5a, 0x950f8ccf, 0xa5cf9b4f,
0xbddfaf1f, 0xd1ffc93f, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x3fffffff, 0x3fffffff, 0x3fffffff, 0x0003ffff, 0x79a8aa1f,
0x08000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x1ce739ce, 0x000001ce,
0x00000007, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x3f3f3f3f, 0x3f3f3f3f, 0x3f3f3f3f,
0x00000000, 0x1ce739ce, 0x000000c0, 0x00180a68, 0x0510001c,
0x00009b40, 0x012a8160, 0x09249126, 0x00180a68, 0x0510001c,
0x00009b40, 0x012a8160, 0x09249126, 0x0001c600, 0x004b6a8e,
0x000003ce, 0x00181400, 0x00820820, 0x066c420f, 0x0f282207,
0x17601685, 0x1f801104, 0x37a00c03, 0x3fc40883, 0x57c00803,
0x5fd80682, 0x7fe00482, 0x7f3c7bba, 0xf3307ff0
};
/* NB: apply AR_PHY(). */
static const uint8_t ar5416_banks_regs[] = {
0x2c, 0x38, 0x2c, 0x3b, 0x2c, 0x38, 0x3c, 0x2c, 0x3a, 0x2c, 0x39,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c,
0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x2c, 0x38, 0x2c, 0x2c,
0x2c, 0x3c
};
static const uint32_t ar5416_banks_vals_5ghz[] = {
0x1e5795e5, 0x02008020, 0x02108421, 0x00000008, 0x0e73ff17,
0x00000420, 0x01400018, 0x000001a1, 0x00000001, 0x00000013,
0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00004000, 0x00006c00, 0x00002c00, 0x00004800,
0x00004000, 0x00006000, 0x00001000, 0x00004000, 0x00007c00,
0x00007c00, 0x00007c00, 0x00007c00, 0x00007c00, 0x00087c00,
0x00007c00, 0x00005400, 0x00000c00, 0x00001800, 0x00007c00,
0x00006c00, 0x00006c00, 0x00007c00, 0x00002c00, 0x00003c00,
0x00003800, 0x00001c00, 0x00000800, 0x00000408, 0x00004c15,
0x00004188, 0x0000201e, 0x00010408, 0x00000801, 0x00000c08,
0x0000181e, 0x00001016, 0x00002800, 0x00004010, 0x0000081c,
0x00000115, 0x00000015, 0x00000066, 0x0000001c, 0x00000000,
0x00000004, 0x00000015, 0x0000001f, 0x00000000, 0x000000a0,
0x00000000, 0x00000040, 0x0000001c
};
static const uint32_t ar5416_banks_vals_2ghz[] = {
0x1e5795e5, 0x02008020, 0x02108421, 0x00000008, 0x0e73ff17,
0x00000420, 0x01c00018, 0x000001a1, 0x00000001, 0x00000013,
0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00004000, 0x00006c00, 0x00002c00, 0x00004800,
0x00004000, 0x00006000, 0x00001000, 0x00004000, 0x00007c00,
0x00007c00, 0x00007c00, 0x00007c00, 0x00007c00, 0x00087c00,
0x00007c00, 0x00005400, 0x00000c00, 0x00001800, 0x00007c00,
0x00006c00, 0x00006c00, 0x00007c00, 0x00002c00, 0x00003c00,
0x00003800, 0x00001c00, 0x00000800, 0x00000408, 0x00004c15,
0x00004188, 0x0000201e, 0x00010408, 0x00000801, 0x00000c08,
0x0000181e, 0x00001016, 0x00002800, 0x00004010, 0x0000081c,
0x00000115, 0x00000015, 0x00000066, 0x0000001c, 0x00000000,
0x00000004, 0x00000015, 0x0000001f, 0x00000400, 0x000000a0,
0x00000000, 0x00000040, 0x0000001c
};
/*
* EEPROM.
*/
@ -792,196 +414,5 @@ typedef struct ar5416eeprom {
CAL_TARGET_POWER_HT calTPow2GHT40[AR5416_NUM_2G_40_TARGET_POWERS];
uint8_t ctlIndex[AR5416_NUM_CTLS];
CAL_CTL_DATA ctlData[AR5416_NUM_CTLS];
uint8_t padding;
uint8_t padding[3];
} __packed AR5416_EEPROM;
#define OTUS_TX_DATA_LIST_COUNT 8
#define OTUS_RX_DATA_LIST_COUNT 1
#define OTUS_CMD_TIMEOUT 1000
#define OTUS_TX_TIMEOUT 1000
#define OTUS_UID(aid) (IEEE80211_AID(aid) + 4)
#define OTUS_MAX_TXCMDSZ 64
#define OTUS_RXBUFSZ (8 * 1024)
#define OTUS_TXBUFSZ (4 * 1024)
/* Default EDCA parameters for when QoS is disabled. */
static const struct ieee80211_edca_ac_params otus_edca_def[EDCA_NUM_AC] = {
{ 4, 10, 3, 0 },
{ 4, 10, 7, 0 },
{ 3, 4, 2, 94 },
{ 2, 3, 2, 47 }
};
#define OTUS_RIDX_CCK1 0
#define OTUS_RIDX_OFDM6 4
#define OTUS_RIDX_OFDM24 8
#define OTUS_RIDX_MAX 11
static const struct otus_rate {
uint8_t rate;
uint8_t mcs;
} otus_rates[] = {
{ 2, 0x0 },
{ 4, 0x1 },
{ 11, 0x2 },
{ 22, 0x3 },
{ 12, 0xb },
{ 18, 0xf },
{ 24, 0xa },
{ 36, 0xe },
{ 48, 0x9 },
{ 72, 0xd },
{ 96, 0x8 },
{ 108, 0xc }
};
struct otus_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
uint8_t wr_flags;
uint8_t wr_rate;
uint16_t wr_chan_freq;
uint16_t wr_chan_flags;
uint8_t wr_antsignal;
} __packed;
#define OTUS_RX_RADIOTAP_PRESENT \
(1 << IEEE80211_RADIOTAP_FLAGS | \
1 << IEEE80211_RADIOTAP_RATE | \
1 << IEEE80211_RADIOTAP_CHANNEL | \
1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)
struct otus_tx_radiotap_header {
struct ieee80211_radiotap_header wt_ihdr;
uint8_t wt_flags;
uint8_t wt_rate;
uint16_t wt_chan_freq;
uint16_t wt_chan_flags;
} __packed;
#define OTUS_TX_RADIOTAP_PRESENT \
(1 << IEEE80211_RADIOTAP_FLAGS | \
1 << IEEE80211_RADIOTAP_RATE | \
1 << IEEE80211_RADIOTAP_CHANNEL)
struct otus_softc;
struct otus_tx_cmd {
usbd_xfer_handle xfer;
uint8_t *buf;
void *odata;
uint16_t token;
uint8_t done;
};
struct otus_rx_data {
struct otus_softc *sc;
usbd_xfer_handle xfer;
uint8_t *buf;
};
struct otus_tx_data {
struct otus_softc *sc;
usbd_xfer_handle xfer;
uint8_t *buf;
};
struct otus_host_cmd {
void (*cb)(struct otus_softc *, void *);
uint8_t data[256];
};
#define OTUS_HOST_CMD_RING_COUNT 32
struct otus_host_cmd_ring {
struct otus_host_cmd cmd[OTUS_HOST_CMD_RING_COUNT];
int cur;
int next;
int queued;
};
struct otus_node {
struct ieee80211_node ni;
struct ieee80211_amrr_node amn;
uint8_t ridx[IEEE80211_RATE_MAXSIZE];
};
struct otus_cmd_newstate {
enum ieee80211_state state;
int arg;
};
struct otus_cmd_key {
struct ieee80211_key key;
uint16_t associd;
};
struct otus_softc {
struct device sc_dev;
struct ieee80211com sc_ic;
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
void (*sc_led_newstate)(struct otus_softc *);
usbd_device_handle sc_udev;
usbd_interface_handle sc_iface;
struct ar5416eeprom eeprom;
uint8_t capflags;
uint8_t rxmask;
uint8_t txmask;
usbd_pipe_handle data_tx_pipe;
usbd_pipe_handle data_rx_pipe;
usbd_pipe_handle cmd_tx_pipe;
usbd_pipe_handle cmd_rx_pipe;
uint8_t *ibuf;
int sc_if_flags;
int sc_tx_timer;
int fixed_ridx;
int bb_reset;
struct ieee80211_channel *sc_curchan;
struct usb_task sc_task;
struct timeout scan_to;
struct timeout calib_to;
struct ieee80211_amrr amrr;
int write_idx;
int tx_cur;
int tx_queued;
uint32_t led_state;
const uint32_t *phy_vals;
struct {
uint32_t reg;
uint32_t val;
} __packed write_buf[AR_MAX_WRITE_IDX + 1];
struct otus_host_cmd_ring cmdq;
struct otus_tx_cmd tx_cmd;
struct otus_tx_data tx_data[OTUS_TX_DATA_LIST_COUNT];
struct otus_rx_data rx_data[OTUS_RX_DATA_LIST_COUNT];
#if NBPFILTER > 0
caddr_t sc_drvbpf;
union {
struct otus_rx_radiotap_header th;
uint8_t pad[64];
} sc_rxtapu;
#define sc_rxtap sc_rxtapu.th
int sc_rxtap_len;
union {
struct otus_tx_radiotap_header th;
uint8_t pad[64];
} sc_txtapu;
#define sc_txtap sc_txtapu.th
int sc_txtap_len;
#endif
};

279
sys/dev/usb/if_otusvar.h Normal file
View File

@ -0,0 +1,279 @@
/* $NetBSD: if_otusvar.h,v 1.1 2010/11/03 20:03:02 christos Exp $ */
/* $OpenBSD: if_otusreg.h,v 1.6 2009/04/06 18:17:01 damien Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
* Copyright (c) 2007-2008 Atheros Communications, Inc.
*
* Permission to use, copy, modify, and 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 HAVE_EDCA
/************************************************************
* XXX: This block belongs in sys/net80211/ieee80211_var.h.
*/
/*
* EDCA AC parameters.
*/
struct ieee80211_edca_ac_params {
u_int8_t ac_ecwmin; /* CWmin = 2^ECWmin - 1 */
u_int8_t ac_ecwmax; /* CWmax = 2^ECWmax - 1 */
u_int8_t ac_aifsn;
u_int16_t ac_txoplimit; /* 32TU */
u_int8_t ac_acm;
};
/************************************************************/
#endif /* ! HAVE_EDCA */
#ifndef HAVE_EDCA
/************************************************************
* XXX: This block belongs in sys/net80211/ieee80211.h.
*/
/*
* EDCA Access Categories.
*/
enum ieee80211_edca_ac {
EDCA_AC_BK = 1, /* Background */
EDCA_AC_BE = 0, /* Best Effort */
EDCA_AC_VI = 2, /* Video */
EDCA_AC_VO = 3 /* Voice */
};
#define EDCA_NUM_AC 4
/* XXX: OpenBSD has more of these defined with the standard referenced */
#define IEEE80211_QOS_ACK_POLICY_NOACK 0x0020
#define IEEE80211_QOS_ACK_POLICY_MASK 0x0060
static __inline int
ieee80211_has_addr4(const struct ieee80211_frame *wh)
{
return (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) ==
IEEE80211_FC1_DIR_DSTODS;
}
static __inline int
ieee80211_has_qos(const struct ieee80211_frame *wh)
{
return (wh->i_fc[0] &
(IEEE80211_FC0_TYPE_MASK | IEEE80211_FC0_SUBTYPE_QOS)) ==
(IEEE80211_FC0_TYPE_DATA | IEEE80211_FC0_SUBTYPE_QOS);
}
static __inline u_int16_t
ieee80211_get_qos(const struct ieee80211_frame *wh)
{
const u_int8_t *frm;
if (ieee80211_has_addr4(wh))
frm = ((const struct ieee80211_qosframe_addr4 *)wh)->i_qos;
else
frm = ((const struct ieee80211_qosframe *)wh)->i_qos;
return le16toh(*(const u_int16_t *)frm);
}
/************************************************************/
#endif /* ! HAVE_EDCA */
/* Default EDCA parameters for when QoS is disabled. */
static const struct ieee80211_edca_ac_params otus_edca_def[] = {
{ 4, 10, 3, 0, 0 },
{ 4, 10, 7, 0, 0 },
{ 3, 4, 2, 94, 0 },
{ 2, 3, 2, 47, 0 }
};
#define OTUS_TX_DATA_LIST_COUNT 8
#define OTUS_RX_DATA_LIST_COUNT 1
#define OTUS_CMD_TIMEOUT 1000
#define OTUS_TX_TIMEOUT 1000
#define OTUS_UID(aid) (IEEE80211_AID(aid) + 4)
#define OTUS_MAX_TXCMDSZ 64
#define OTUS_RXBUFSZ (8 * 1024)
#define OTUS_TXBUFSZ (4 * 1024)
#define OTUS_RIDX_CCK1 0
#define OTUS_RIDX_OFDM6 4
#define OTUS_RIDX_OFDM24 8
#define OTUS_RIDX_MAX 11
static const struct otus_rate {
uint8_t rate;
uint8_t mcs;
} otus_rates[] = {
{ 2, 0x0 },
{ 4, 0x1 },
{ 11, 0x2 },
{ 22, 0x3 },
{ 12, 0xb },
{ 18, 0xf },
{ 24, 0xa },
{ 36, 0xe },
{ 48, 0x9 },
{ 72, 0xd },
{ 96, 0x8 },
{ 108, 0xc }
};
struct otus_rx_radiotap_header {
struct ieee80211_radiotap_header wr_ihdr;
uint8_t wr_flags;
uint8_t wr_rate;
uint16_t wr_chan_freq;
uint16_t wr_chan_flags;
uint8_t wr_antsignal;
} __packed;
#define OTUS_RX_RADIOTAP_PRESENT \
(1 << IEEE80211_RADIOTAP_FLAGS | \
1 << IEEE80211_RADIOTAP_RATE | \
1 << IEEE80211_RADIOTAP_CHANNEL | \
1 << IEEE80211_RADIOTAP_DB_ANTSIGNAL)
struct otus_tx_radiotap_header {
struct ieee80211_radiotap_header wt_ihdr;
uint8_t wt_flags;
uint8_t wt_rate;
uint16_t wt_chan_freq;
uint16_t wt_chan_flags;
} __packed;
#define OTUS_TX_RADIOTAP_PRESENT \
(1 << IEEE80211_RADIOTAP_FLAGS | \
1 << IEEE80211_RADIOTAP_RATE | \
1 << IEEE80211_RADIOTAP_CHANNEL)
struct otus_softc;
struct otus_tx_cmd {
usbd_xfer_handle xfer;
uint8_t *buf;
void *odata;
uint16_t token;
uint8_t done;
};
struct otus_rx_data {
struct otus_softc *sc;
usbd_xfer_handle xfer;
uint8_t *buf;
};
struct otus_tx_data {
struct otus_softc *sc;
usbd_xfer_handle xfer;
uint8_t *buf;
};
struct otus_host_cmd {
void (*cb)(struct otus_softc *, void *);
uint8_t data[256];
};
#define OTUS_HOST_CMD_RING_COUNT 32
struct otus_host_cmd_ring {
struct otus_host_cmd cmd[OTUS_HOST_CMD_RING_COUNT];
int cur;
int next;
int queued;
};
struct otus_node {
struct ieee80211_node ni; /* must be first */
struct ieee80211_amrr_node amn;
uint8_t ridx[IEEE80211_RATE_MAXSIZE];
};
struct otus_cmd_newstate {
enum ieee80211_state state;
int arg;
};
struct otus_cmd_key {
struct ieee80211_key key;
uint16_t associd;
};
struct otus_softc {
device_t sc_dev;
struct ieee80211com sc_ic;
struct ethercom sc_ec;
#define sc_if sc_ec.ec_if
int (*sc_newstate)(struct ieee80211com *,
enum ieee80211_state, int);
void (*sc_led_newstate)(struct otus_softc *);
usbd_device_handle sc_udev;
usbd_interface_handle sc_iface;
struct ar5416eeprom sc_eeprom;
uint8_t sc_capflags;
uint8_t sc_rxmask;
uint8_t sc_txmask;
usbd_pipe_handle sc_data_tx_pipe;
usbd_pipe_handle sc_data_rx_pipe;
usbd_pipe_handle sc_cmd_tx_pipe;
usbd_pipe_handle sc_cmd_rx_pipe;
uint8_t *sc_ibuf;
int sc_if_flags;
int sc_tx_timer;
int sc_fixed_ridx;
int sc_bb_reset;
struct ieee80211_channel *sc_curchan;
struct usb_task sc_task;
callout_t sc_scan_to;
callout_t sc_calib_to;
struct ieee80211_amrr sc_amrr;
unsigned int sc_write_idx;
int sc_tx_cur;
int sc_tx_queued;
uint32_t sc_led_state;
kmutex_t sc_cmd_mtx;
kmutex_t sc_task_mtx;
kmutex_t sc_write_mtx;
const uint32_t *sc_phy_vals;
struct {
uint32_t reg;
uint32_t val;
} __packed sc_write_buf[AR_FW_MAX_WRITES];
struct otus_host_cmd_ring sc_cmdq;
struct otus_tx_cmd sc_tx_cmd;
struct otus_tx_data sc_tx_data[OTUS_TX_DATA_LIST_COUNT];
struct otus_rx_data sc_rx_data[OTUS_RX_DATA_LIST_COUNT];
struct bpf_if * sc_drvbpf;
union {
struct otus_rx_radiotap_header th;
uint8_t pad[64];
} sc_rxtapu;
#define sc_rxtap sc_rxtapu.th
int sc_rxtap_len;
union {
struct otus_tx_radiotap_header th;
uint8_t pad[64];
} sc_txtapu;
#define sc_txtap sc_txtapu.th
int sc_txtap_len;
};

View File

@ -1,4 +1,4 @@
$NetBSD: usbdevs,v 1.564 2010/10/18 16:10:55 sborrill Exp $
$NetBSD: usbdevs,v 1.565 2010/11/03 20:03:02 christos Exp $
/*
* Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@ -406,6 +406,7 @@ vendor SEALEVEL 0x0c52 Sealevel System
vendor LUWEN 0x0c76 EasyDisk
vendor QUALCOMM_K 0x0c88 Qualcomm Kyocera
vendor ZCOM 0x0cde Z-Com
vendor ATHEROS2 0x0cf3 Atheros Communications
vendor TANGTOP 0x0d3d Tangtop
vendor SMC3 0x0d5c Standard Microsystems
vendor PEN 0x0d7d Pen Drive
@ -485,6 +486,7 @@ vendor INSIDEOUT 0x1608 Inside Out Networks
vendor GOODWAY 0x1631 Good Way Technology
vendor ENTREGA 0x1645 Entrega
vendor ACTIONTEC 0x1668 Actiontec Electronics
vendor ATHEROS 0x168c Atheros Communications
vendor GIGASET 0x1690 Gigaset
vendor ANYDATA 0x16d5 AnyDATA Inc.
vendor JABLOTRON 0x16d6 Jablotron
@ -527,6 +529,7 @@ vendor ARKMICROCHIPS 0x6547 ArkMicroChips
vendor 3COM2 0x6891 3Com
vendor INTEL 0x8086 Intel
vendor MOSCHIP 0x9710 MosChip Semiconductor
vendor CACE 0xcace CACE Technologies
vendor EMPIA 0xeb1a eMPIA Technology
vendor HP2 0xf003 Hewlett Packard
vendor USRP 0xfffe GNU Radio USRP
@ -578,11 +581,29 @@ product ABOCOM WUG2700 0xb21f WUG2700
/* Accton products */
product ACCTON USB320_EC 0x1046 USB320-EC Ethernet Adapter
product ACCTON 2664W 0x3501 2664W
product ACCTON 111 0x3503 T-Sinus 111 WLAN
product ACCTON SMCWUSBG 0x4505 SMCWUSB-G
product ACCTON SMCWUSBTG2 0x4506 SMCWUSBT-G2
product ACCTON SMCWUSBTG2_NF 0x4507 SMCWUSBT-G2
product ACCTON PRISM_GT 0x4521 PrismGT USB 2.0 WLAN
product ACCTON SS1001 0x5046 SpeedStream Ethernet Adapter
product ACCTON RT2870_2 0x6618 RT2870
product ACCTON RT3070 0x7511 RT3070
product ACCTON RT2770 0x7512 RT2770
product ACCTON RT2870_3 0x7522 RT2870
product ACCTON RT2870_5 0x8522 RT2870
product ACCTON RT3070_4 0xa512 RT3070
product ACCTON RT2870_4 0xa618 RT2870
product ACCTON RT3070_1 0xa701 RT3070
product ACCTON RT3070_2 0xa702 RT3070
product ACCTON RT2870_1 0xb522 RT2870
product ACCTON RT3070_3 0xc522 RT3070
product ACCTON RT3070_5 0xd522 RT3070
product ACCTON ZD1211B 0xe501 ZD1211B
product ACCTON WN4501H_LF_IR 0xe503 WN4501H-LF-IR
product ACCTON WUS201 0xe506 WUS-201
product ACCTON WN7512 0xf522 WN7512
/* Acer Communications & Multimedia products */
product ACERCM EP1427X2 0x0893 EP-1427X-2 Ethernet
@ -746,6 +767,24 @@ product ATEN UC232A 0x2008 Serial adapter
product ATEN UC210T 0x2009 UC210T Ethernet adapter
product ATEN DSB650C 0x4000 DSB-650C
/* Atheros Communications products */
product ATHEROS AR5523 0x0001 AR5523
product ATHEROS AR5523_NF 0x0002 AR5523
/* Atheros Communications(2) products */
product ATHEROS2 AR5523_1 0x0001 AR5523
product ATHEROS2 AR5523_1_NF 0x0002 AR5523
product ATHEROS2 AR5523_2 0x0003 AR5523
product ATHEROS2 AR5523_2_NF 0x0004 AR5523
product ATHEROS2 AR5523_3 0x0005 AR5523
product ATHEROS2 AR5523_3_NF 0x0006 AR5523
product ATHEROS2 TG121N 0x1001 TG121N
product ATHEROS2 WN821NV2 0x1002 WN821NV2
product ATHEROS2 3CRUSBN275 0x1010 3CRUSBN275
product ATHEROS2 WN612 0x1011 WN612
product ATHEROS2 AR3011 0x3000 AR3011
product ATHEROS2 AR9170 0x9170 AR9170
/* ATI products */
product ATI2 205 0xa001 USB Cable 205
@ -770,6 +809,9 @@ product AVERATEC USBWLAN 0x4013 WLAN
/* Avision products */
product AVISION 1200U 0x0268 1200U scanner
/* AVM products */
product AVM FRITZWLAN 0x8401 FRITZ!WLAN N
/* Baltech products */
product BALTECH CARDREADER 0x9999 Card reader
@ -814,6 +856,9 @@ product BROTHER HL1050 0x0002 HL-1050 laser printer
/* Behavior Technology Computer products */
product BTC BTC7932 0x6782 Keyboard with mouse port
/* CACE Technologies products */
product CACE AIRPCAPNX 0x0300 AirPcap Nx
/* Canon, Inc. products */
product CANON N656U 0x2206 CanoScan N656U
product CANON N1220U 0x2207 CanoScan N1220U
@ -1005,13 +1050,23 @@ product DISPLAYLINK UM7X0 0x401a nanovision MiMo
/*product DLINK DSBS25 0x0100 DSB-S25 serial adapter*/
product DLINK DUBE100 0x1a00 10/100 ethernet adapter
product DLINK DSB650TX4 0x200c 10/100 ethernet adapter
product DLINK DWL120E 0x3200 DWL-120 rev E
product DLINK DWA130C 0x3301 DWA-130 rev C
product DLINK DWL122 0x3700 Wireless DWL122
product DLINK DWLG120 0x3701 DWL-G120
product DLINK DWL120F 0x3702 DWL-120 rev F
product DLINK DWLG122A2 0x3704 DWL-G122 rev A2
product DLINK DWLAG132 0x3a00 DWL-AG132
product DLINK DWLAG132_NF 0x3a01 DWL-AG132
product DLINK DWLG132 0x3a02 DWL-G132
product DLINK DWLG132_NF 0x3a03 DWL-G132
product DLINK DWLAG122 0x3a04 DWL-AG122
product DLINK DWLAG122_NF 0x3a05 DWL-AG122
product DLINK DWLG122 0x3c00 AirPlus G Wireless USB Adapter
product DLINK2 DWLG122C1 0x3c03 DWL-G122 rev C1
product DLINK2 WUA1340 0x3c04 WUA-1340
/* product DLINK RT2570 0x3c00 RT2570 */
product DLINK DUBE100B1 0x3c05 DUB-E100 rev B1
product DLINK2 DWA111 0x3c06 DWA-111
product DLINK RT2870 0x3c09 RT2870
product DLINK RT3072 0x3c0a RT3072
product DLINK DSB650C 0x4000 10Mbps ethernet adapter
product DLINK DSB650TX1 0x4001 10/100 ethernet adapter
product DLINK DSB650TX 0x4002 10/100 ethernet adapter
@ -1020,6 +1075,28 @@ product DLINK DSB650TX3 0x400b 10/100 ethernet adapter
product DLINK DSB650TX2 0x4102 10/100 ethernet adapter
product DLINK DSB650 0xabc1 10/100 ethernet adapter
/* D-Link(2) products */
product DLINK2 DWA160A2 0x3a09 DWA-160 A2
product DLINK2 DWA130D1 0x3a0f DWA-130 rev D1
product DLINK2 DWLG122C1 0x3c03 DWL-G122 rev C1
product DLINK2 WUA1340 0x3c04 WUA-1340
product DLINK2 DWA111 0x3c06 DWA-111
product DLINK2 DWA110 0x3c07 DWA-110
product DLINK2 RT2870_1 0x3c09 RT2870
product DLINK2 RT3072 0x3c0a RT3072
product DLINK2 RT3072_1 0x3c0b RT3072
product DLINK2 RT3070_1 0x3c0d RT3070
product DLINK2 RT3070_2 0x3c0e RT3070
product DLINK2 RT3070_3 0x3c0f RT3070
product DLINK2 DWA160A1 0x3c10 DWA-160 A1
product DLINK2 RT2870_2 0x3c11 RT2870
product DLINK2 DWA130 0x3c13 DWA-130
product DLINK2 RT3070_4 0x3c15 RT3070
product DLINK2 RT3070_5 0x3c16 RT3070
/* D-Link(3) products */
product DLINK3 KVM221 0x020f KVM-221
/* DMI products */
product DMI SA2_0 0xb001 Storage Adapter
@ -1372,11 +1449,22 @@ product IODATA USBSDRW 0x031e USB-SDRW SD-card adapter
product IODATA USBETT 0x0901 USB ET/T
product IODATA USBETTX 0x0904 USB ET/TX
product IODATA USBETTXS 0x0913 USB ET/TX-S
product IODATA USBWNB11A 0x0919 USB WN-B11
product IODATA USBWNB11 0x0922 USB Airport WN-B11
product IODATA USBWNG54US 0x0928 USB WN-G54/US
product IODATA USBWNG54US_NF 0x0929 USB WN-G54/US
product IODATA ETXUS2 0x092a ETX-US2
product IODATA ETGUS2 0x0930 ETG-US2
product IODATA FT232R 0x093c FT232R
product IODATA WNGDNUS2 0x093f WN-GDN/US2
product IODATA RT3072_1 0x0944 RT3072
product IODATA RT3072_2 0x0945 RT3072
product IODATA RT3072_3 0x0947 RT3072
product IODATA RT3072_4 0x0948 RT3072
product IODATA USBRSAQ 0x0a03 USB serial adapter USB-RSAQ1
product IODATA USBRSAQ5 0x0a0e USB serial adapter USB-RSAQ5
/* I-O DATA(2) products */
product IODATA2 USB2SC 0x0a09 USB2.0-SCSI Bridge USB2-SC
/* Iomega products */
@ -1456,7 +1544,6 @@ product KEYSPAN UIA11 0x0202 UIA-11 remote control
/* Kingston products */
product KINGSTON XX1 0x0008 Ethernet Adapter
product KINGSTON KNU101TX 0x000a KNU101TX USB Ethernet
product KINGSTON DTMINI10 0x162c DT Mini 10
/* Kodak products */
product KODAK DC220 0x0100 Digital Science DC220
@ -1740,6 +1827,7 @@ product NATIONAL BEARPAW2400 0x1001 BearPaw 2400
/* NEC products */
product NEC HUB_20 0x0059 2.0 hub
product NEC WL300NUG 0x0249 WL300NU-G
product NEC HUB 0x55aa hub
product NEC HUB_B 0x55ab hub
product NEC PICTY760 0xbef4 Picty760
@ -1765,12 +1853,27 @@ product NETGEAR EA101X 0x1002 Ethernet adapter
product NETGEAR FA101 0x1020 10/100 Ethernet
product NETGEAR FA120 0x1040 USB 2.0 Fast Ethernet Adapter
product NETGEAR MA111NA 0x4110 802.11b Adapter
product NETGEAR MA111V2 0x4230 802.11b V2
product NETGEAR WG111V2_2 0x4240 PrismGT USB 2.0 WLAN
product NETGEAR WG111V3 0x4260 WG111v3
product NETGEAR WG111U 0x4300 WG111U
product NETGEAR WG111U_NF 0x4301 WG111U
product NETGEAR WG111V2 0x6a00 WG111v2
product NETGEAR XA601 0x8100 USB to PL Adapter
product NETGEAR WN111V2 0x9001 WN111V2
product NETGEAR WNDA3100 0x9010 WNDA3100
product NETGEAR WNA1000 0x9040 WNA1000
/* Netgear(2) products */
product NETGEAR2 MA101 0x4100 MA101
product NETGEAR2 MA101B 0x4102 MA101 Rev B
/* Netgear(3) products */
product NETGEAR3 WG111T 0x4250 WG111T
product NETGEAR3 WG111T_NF 0x4251 WG111T
product NETGEAR3 WPN111 0x5f00 WPN111
product NETGEAR3 WPN111_NF 0x5f01 WPN111
/* NetIndex products */
product NETINDEX WS002IN 0x2001 Willcom WS002IN (DD)
@ -1938,14 +2041,24 @@ product PINNACLE PCTV800E 0x0227 PCTV 800e
product PLANEX GW_US11H 0x14ea GW-US11H WLAN
product PLANEX2 GW_US11S 0x3220 GW-US11S WLAN
product PLANEX2 GWUS54GXS 0x5303 GW-US54GXS
product PLANEX2 GW_US300 0x5304 GW-US300
product PLANEX2 GWUS54HP 0xab01 GW-US54HP
product PLANEX3 GU1000T 0xab11 GU-1000T
product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini
product PLANEX2 GWUS54MINI2 0xab50 GW-US54Mini2
product PLANEX2 GWUS54SG 0xc002 GW-US54SG
product PLANEX2 GWUS54GZL 0xc007 GW-US54GZL
product PLANEX2 GWUS54GD 0xed01 GW-US54GD
product PLANEX2 GWUSMM 0xed02 GW-USMM
product PLANEX2 RT2870 0xed06 RT2870
product PLANEX2 GWUSMICRON 0xed14 GW-USMicroN
product PLANEX3 GWUS54GZ 0xab10 GW-US54GZ
product PLANEX3 GU1000T 0xab11 GU-1000T
product PLANEX3 GWUS54MINI 0xab13 GW-US54Mini
product PLANEX2 GWUS300MINIS 0xab24 GW-US300MiniS
product PLANEX2 RT3070 0xab25 RT3070
/* Plantronics products */
product PLANTRONICS HEADSET 0x0ca1 Platronics DSP-400 Headset
@ -2507,8 +2620,14 @@ product WINCHIPHEAD CH341SER 0x5523 CH341/CH340 USB-Serial Bridge
product WINCHIPHEAD2 CH341 0x7523 CH341 serial/parallel
/* Wistron NeWeb products */
product WISTRONNEWEB WNC0600 0x0326 WNC-0600USB
product WISTRONNEWEB UR045G 0x0427 PrismGT USB 2.0 WLAN
product WISTRONNEWEB UR055G 0x0711 UR055G
product WISTRONNEWEB O8494 0x0804 ORiNOCO 802.11n
product WISTRONNEWEB AR5523_1 0x0826 AR5523
product WISTRONNEWEB AR5523_1_NF 0x0827 AR5523
product WISTRONNEWEB AR5523_2 0x082a AR5523
product WISTRONNEWEB AR5523_2_NF 0x0829 AR5523
/* Xirlink products */
product XIRLINK IMAGING 0x800d IMAGING DEVICE
@ -2545,11 +2664,19 @@ product YANO U640MO 0x0101 U640MO-03
product YEDATA FLASHBUSTERU 0x0000 Flashbuster-U
/* Z-Com products */
product ZCOM M4Y750 0x0001 M4Y-750
product ZCOM 725 0x0002 725/726 Prism2.5 WLAN
product ZCOM XI735 0x0005 XI-735
product ZCOM MD40900 0x0006 MD40900
product ZCOM XG703A 0x0008 PrismGT USB 2.0 WLAN
product ZCOM ZD1211 0x0011 ZD1211
product ZCOM AR5523 0x0012 AR5523
product ZCOM AR5523_NF 0x0013 AR5523
product ZCOM ZD1211B 0x001a ZD1211B
product ZCOM RT2870_1 0x0022 RT2870
product ZCOM UB81 0x0023 UB81
product ZCOM RT2870_2 0x0025 RT2870
product ZCOM UB82 0x0026 UB82
/* Zeevo, Inc. products */
product ZEEVO BLUETOOTH 0x07d0 BT-500 Bluetooth USB Adapter
@ -2562,14 +2689,25 @@ product ZOOM 2986L 0x9700 2986L Fax modem
product ZOOM 3095 0x3095 3095 USB Fax modem
/* Zydas Technology Corporation products */
product ZYDAS ZD1201 0x1201 ZD1201
product ZYDAS ZD1211 0x1211 ZD1211 WLAN abg
product ZYDAS ZD1211B 0x1215 ZD1211B
product ZYDAS ZD1221 0x1221 ZD1221
product ZYDAS ALL0298 0xa211 ALL0298
product ZYDAS ZD1211B_2 0xb215 ZD1211B
/* ZyXEL Communication Co. products */
product ZYXEL OMNI56K 0x1500 Omni 56K Plus
product ZYXEL 980N 0x2011 Scorpion-980N keyboard
product ZYXEL G200V2 0x3407 G-200 v2
product ZYXEL ZYAIRG220 0x3401 ZyAIR G-220
product ZYXEL AG225H 0x3409 AG-225H
product ZYXEL M202 0x340a M-202
product ZYXEL G270S 0x340c G-270S
product ZYXEL G220V2 0x340f G-220 v2
product ZYXEL G202 0x3410 G-202
product ZYXEL RT2573 0x3415 RT2573
product ZYXEL RT2870_1 0x3416 RT2870
product ZYXEL NWD271N 0x3417 NWD-271N
product ZYXEL RT2870_2 0x341a RT2870
product ZYXEL PRESTIGE 0x401a Prestige