u16 errorcount;
};
+struct i2400m_endpoint_cfg {
+ unsigned char bulk_out;
+ unsigned char notification;
+ unsigned char reset_cold;
+ unsigned char bulk_in;
+};
+
static inline void edc_init(struct edc *edc)
{
edc->timestart = jiffies;
I2400MU_MAX_NOTIFICATION_LEN = 256,
I2400MU_BLK_SIZE = 16,
I2400MU_PL_SIZE_MAX = 0x3EFF,
-
- /* Endpoints */
- I2400MU_EP_BULK_OUT = 0,
- I2400MU_EP_NOTIFICATION,
- I2400MU_EP_RESET_COLD,
- I2400MU_EP_BULK_IN,
};
struct usb_device *usb_dev;
struct usb_interface *usb_iface;
struct edc urb_edc; /* Error density counter */
+ struct i2400m_endpoint_cfg endpoint_cfg;
struct urb *notif_urb;
struct task_struct *tx_kthread;
dev_err(dev, "BM-CMD: can't get autopm: %d\n", result);
do_autopm = 0;
}
- epd = usb_get_epd(i2400mu->usb_iface, I2400MU_EP_BULK_OUT);
+ epd = usb_get_epd(i2400mu->usb_iface, i2400mu->endpoint_cfg.bulk_out);
pipe = usb_sndbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress);
retry:
result = usb_bulk_msg(i2400mu->usb_dev, pipe, buf, buf_size, &len, HZ);
struct usb_endpoint_descriptor *epd;
int pipe;
- epd = usb_get_epd(i2400mu->usb_iface, I2400MU_EP_NOTIFICATION);
+ epd = usb_get_epd(i2400mu->usb_iface,
+ i2400mu->endpoint_cfg.notification);
pipe = usb_rcvintpipe(i2400mu->usb_dev, epd->bEndpointAddress);
usb_fill_int_urb(urb, i2400mu->usb_dev, pipe,
i2400m->bm_ack_buf, I2400M_BM_ACK_BUF_SIZE,
dev_err(dev, "notification: cannot allocate URB\n");
goto error_alloc_urb;
}
- epd = usb_get_epd(i2400mu->usb_iface, I2400MU_EP_NOTIFICATION);
+ epd = usb_get_epd(i2400mu->usb_iface,
+ i2400mu->endpoint_cfg.notification);
usb_pipe = usb_rcvintpipe(i2400mu->usb_dev, epd->bEndpointAddress);
usb_fill_int_urb(i2400mu->notif_urb, i2400mu->usb_dev, usb_pipe,
buf, I2400MU_MAX_NOTIFICATION_LEN,
dev_err(dev, "RX: can't get autopm: %d\n", result);
do_autopm = 0;
}
- epd = usb_get_epd(i2400mu->usb_iface, I2400MU_EP_BULK_IN);
+ epd = usb_get_epd(i2400mu->usb_iface, i2400mu->endpoint_cfg.bulk_in);
usb_pipe = usb_rcvbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress);
retry:
rx_size = skb_end_pointer(rx_skb) - rx_skb->data - rx_skb->len;
dev_err(dev, "TX: can't get autopm: %d\n", result);
do_autopm = 0;
}
- epd = usb_get_epd(i2400mu->usb_iface, I2400MU_EP_BULK_OUT);
+ epd = usb_get_epd(i2400mu->usb_iface, i2400mu->endpoint_cfg.bulk_out);
usb_pipe = usb_sndbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress);
retry:
result = usb_bulk_msg(i2400mu->usb_dev, usb_pipe,
d_fnstart(3, dev, "(i2400m %p rt %u)\n", i2400m, rt);
if (rt == I2400M_RT_WARM)
- result = __i2400mu_send_barker(i2400mu, i2400m_WARM_BOOT_BARKER,
- sizeof(i2400m_WARM_BOOT_BARKER),
- I2400MU_EP_BULK_OUT);
+ result = __i2400mu_send_barker(
+ i2400mu, i2400m_WARM_BOOT_BARKER,
+ sizeof(i2400m_WARM_BOOT_BARKER),
+ i2400mu->endpoint_cfg.bulk_out);
else if (rt == I2400M_RT_COLD)
- result = __i2400mu_send_barker(i2400mu, i2400m_COLD_BOOT_BARKER,
- sizeof(i2400m_COLD_BOOT_BARKER),
- I2400MU_EP_RESET_COLD);
+ result = __i2400mu_send_barker(
+ i2400mu, i2400m_COLD_BOOT_BARKER,
+ sizeof(i2400m_COLD_BOOT_BARKER),
+ i2400mu->endpoint_cfg.reset_cold);
else if (rt == I2400M_RT_BUS) {
do_bus_reset:
result = usb_reset_device(i2400mu->usb_dev);
i2400m->bus_fw_names = i2400mu_bus_fw_names;
i2400m->bus_bm_mac_addr_impaired = 0;
+ {
+ i2400mu->endpoint_cfg.bulk_out = 0;
+ i2400mu->endpoint_cfg.notification = 1;
+ i2400mu->endpoint_cfg.reset_cold = 2;
+ i2400mu->endpoint_cfg.bulk_in = 3;
+ }
#ifdef CONFIG_PM
iface->needs_remote_wakeup = 1; /* autosuspend (15s delay) */
device_init_wakeup(dev, 1);