Lines Matching refs:i2400mu
118 size_t i2400mu_rx_size_grow(struct i2400mu *i2400mu)
120 struct device *dev = &i2400mu->usb_iface->dev;
124 rx_size = 2 * i2400mu->rx_size;
130 rx_size, i2400mu->rx_size);
134 rx_size, i2400mu->rx_size);
140 void i2400mu_rx_size_maybe_shrink(struct i2400mu *i2400mu)
143 struct device *dev = &i2400mu->usb_iface->dev;
145 if (unlikely(i2400mu->rx_size_cnt >= 100
146 && i2400mu->rx_size_auto_shrink)) {
148 i2400mu->rx_size_acc / i2400mu->rx_size_cnt;
149 size_t new_rx_size = i2400mu->rx_size / 2;
156 new_rx_size, i2400mu->rx_size);
161 new_rx_size, i2400mu->rx_size);
162 i2400mu->rx_size = new_rx_size;
163 i2400mu->rx_size_cnt = 0;
164 i2400mu->rx_size_acc = i2400mu->rx_size;
172 * @i2400mu: USB device descriptor
192 struct sk_buff *i2400mu_rx(struct i2400mu *i2400mu, struct sk_buff *rx_skb)
195 struct device *dev = &i2400mu->usb_iface->dev;
200 d_fnstart(4, dev, "(i2400mu %p)\n", i2400mu);
201 do_autopm = atomic_read(&i2400mu->do_autopm);
203 usb_autopm_get_interface(i2400mu->usb_iface) : 0;
208 epd = usb_get_epd(i2400mu->usb_iface, i2400mu->endpoint_cfg.bulk_in);
209 usb_pipe = usb_rcvbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress);
217 i2400mu->usb_dev, usb_pipe, rx_skb->data + rx_skb->len,
219 usb_mark_last_busy(i2400mu->usb_dev);
237 if (edc_inc(&i2400mu->urb_edc,
243 usb_clear_halt(i2400mu->usb_dev, usb_pipe);
254 rx_size = i2400mu_rx_size_grow(i2400mu);
256 i2400mu->rx_size = rx_size;
275 i2400mu->rx_size_cnt = 0;
276 i2400mu->rx_size_acc = i2400mu->rx_size;
292 if (edc_inc(&i2400mu->urb_edc,
300 usb_autopm_put_interface(i2400mu->usb_iface);
301 d_fnend(4, dev, "(i2400mu %p) = %p\n", i2400mu, rx_skb);
308 usb_queue_reset_device(i2400mu->usb_iface);
334 struct i2400mu *i2400mu = _i2400mu;
335 struct i2400m *i2400m = &i2400mu->i2400m;
336 struct device *dev = &i2400mu->usb_iface->dev;
343 d_fnstart(4, dev, "(i2400mu %p)\n", i2400mu);
345 BUG_ON(i2400mu->rx_kthread != NULL);
346 i2400mu->rx_kthread = current;
352 i2400mu->rx_wq,
354 || (pending = atomic_read(&i2400mu->rx_pending_count)))
360 rx_size = i2400mu->rx_size;
371 rx_skb = i2400mu_rx(i2400mu, rx_skb);
375 atomic_dec(&i2400mu->rx_pending_count);
383 i2400mu->rx_size_cnt++;
384 i2400mu->rx_size_acc += rx_skb->len;
387 && edc_inc(&i2400mu->urb_edc,
393 i2400mu_rx_size_maybe_shrink(i2400mu);
398 i2400mu->rx_kthread = NULL;
400 d_fnend(4, dev, "(i2400mu %p) = %d\n", i2400mu, result);
406 usb_queue_reset_device(i2400mu->usb_iface);
418 void i2400mu_rx_kick(struct i2400mu *i2400mu)
420 struct i2400m *i2400m = &i2400mu->i2400m;
421 struct device *dev = &i2400mu->usb_iface->dev;
423 d_fnstart(3, dev, "(i2400mu %p)\n", i2400m);
424 atomic_inc(&i2400mu->rx_pending_count);
425 wake_up_all(&i2400mu->rx_wq);
430 int i2400mu_rx_setup(struct i2400mu *i2400mu)
433 struct i2400m *i2400m = &i2400mu->i2400m;
434 struct device *dev = &i2400mu->usb_iface->dev;
438 kthread = kthread_run(i2400mu_rxd, i2400mu, "%s-rx",
440 /* the kthread function sets i2400mu->rx_thread */
449 void i2400mu_rx_release(struct i2400mu *i2400mu)
452 struct i2400m *i2400m = &i2400mu->i2400m;
457 kthread = i2400mu->rx_kthread;
458 i2400mu->rx_kthread = NULL;