• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/uwb/i1480/
1
2
3#include <linux/init.h>
4#include <linux/module.h>
5#include <linux/usb.h>
6#include <linux/uwb.h>
7#include "dfu/i1480-dfu.h"
8
9
10/** Event size table for wEvents 0x00XX */
11static struct uwb_est_entry i1480_est_fd00[] = {
12	/* Anybody expecting this response has to use
13	 * neh->extra_size to specify the real size that will
14	 * come back. */
15	[i1480_EVT_CONFIRM] = { .size = sizeof(struct i1480_evt_confirm) },
16	[i1480_CMD_SET_IP_MAS] = { .size = sizeof(struct i1480_evt_confirm) },
17#ifdef i1480_RCEB_EXTENDED
18	[0x09] = {
19		.size = sizeof(struct i1480_rceb),
20		.offset = 1 + offsetof(struct i1480_rceb, wParamLength),
21	},
22#endif
23};
24
25/** Event size table for wEvents 0x01XX */
26static struct uwb_est_entry i1480_est_fd01[] = {
27	[0xff & i1480_EVT_RM_INIT_DONE] = { .size = sizeof(struct i1480_rceb) },
28	[0xff & i1480_EVT_DEV_ADD] = { .size = sizeof(struct i1480_rceb) + 9 },
29	[0xff & i1480_EVT_DEV_RM] = { .size = sizeof(struct i1480_rceb) + 9 },
30	[0xff & i1480_EVT_DEV_ID_CHANGE] = {
31		.size = sizeof(struct i1480_rceb) + 2 },
32};
33
34static int __init i1480_est_init(void)
35{
36	int result = uwb_est_register(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
37				      i1480_est_fd00,
38				      ARRAY_SIZE(i1480_est_fd00));
39	if (result < 0) {
40		printk(KERN_ERR "Can't register EST table fd00: %d\n", result);
41		return result;
42	}
43	result = uwb_est_register(i1480_CET_VS1, 0x01, 0x8086, 0x0c3b,
44				  i1480_est_fd01, ARRAY_SIZE(i1480_est_fd01));
45	if (result < 0) {
46		printk(KERN_ERR "Can't register EST table fd01: %d\n", result);
47		return result;
48	}
49	return 0;
50}
51module_init(i1480_est_init);
52
53static void __exit i1480_est_exit(void)
54{
55	uwb_est_unregister(i1480_CET_VS1, 0x00, 0x8086, 0x0c3b,
56			   i1480_est_fd00, ARRAY_SIZE(i1480_est_fd00));
57	uwb_est_unregister(i1480_CET_VS1, 0x01, 0x8086, 0x0c3b,
58			   i1480_est_fd01, ARRAY_SIZE(i1480_est_fd01));
59}
60module_exit(i1480_est_exit);
61
62MODULE_AUTHOR("Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>");
63MODULE_DESCRIPTION("i1480's Vendor Specific Event Size Tables");
64MODULE_LICENSE("GPL");
65
66/**
67 * USB device ID's that we handle
68 *
69 * [so we are loaded when this kind device is connected]
70 */
71static struct usb_device_id i1480_est_id_table[] = {
72	{ USB_DEVICE(0x8086, 0xdf3b), },
73	{ USB_DEVICE(0x8086, 0x0c3b), },
74	{ },
75};
76MODULE_DEVICE_TABLE(usb, i1480_est_id_table);
77