hso.c (f8a6b2b9cee298a9663cbe38ce1eb5240987cb62) hso.c (0227abc9d011892fd13f360b56a7b276ebea8b07)
1/******************************************************************************
2 *
3 * Driver for Option High Speed Mobile Devices.
4 *
5 * Copyright (C) 2008 Option International
6 * Filip Aben <f.aben@option.com>
7 * Denis Joseph Barrow <d.barow@option.com>
8 * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd)

--- 922 unchanged lines hidden (view full) ---

931
932 odev->rx_buf_missing -= temp_bytes;
933 count -= temp_bytes;
934 buffer_offset += temp_bytes;
935 odev->rx_buf_size += temp_bytes;
936 if (!odev->rx_buf_missing) {
937 /* Packet is complete. Inject into stack. */
938 /* We have IP packet here */
1/******************************************************************************
2 *
3 * Driver for Option High Speed Mobile Devices.
4 *
5 * Copyright (C) 2008 Option International
6 * Filip Aben <f.aben@option.com>
7 * Denis Joseph Barrow <d.barow@option.com>
8 * Copyright (C) 2007 Andrew Bird (Sphere Systems Ltd)

--- 922 unchanged lines hidden (view full) ---

931
932 odev->rx_buf_missing -= temp_bytes;
933 count -= temp_bytes;
934 buffer_offset += temp_bytes;
935 odev->rx_buf_size += temp_bytes;
936 if (!odev->rx_buf_missing) {
937 /* Packet is complete. Inject into stack. */
938 /* We have IP packet here */
939 odev->skb_rx_buf->protocol =
940 __constant_htons(ETH_P_IP);
939 odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP);
941 /* don't check it */
942 odev->skb_rx_buf->ip_summed =
943 CHECKSUM_UNNECESSARY;
944
945 skb_reset_mac_header(odev->skb_rx_buf);
946
947 /* Ship it off to the kernel */
948 netif_rx(odev->skb_rx_buf);

--- 293 unchanged lines hidden (view full) ---

1242 return;
1243 }
1244}
1245
1246/*
1247 * This needs to be a tasklet otherwise we will
1248 * end up recursively calling this function.
1249 */
940 /* don't check it */
941 odev->skb_rx_buf->ip_summed =
942 CHECKSUM_UNNECESSARY;
943
944 skb_reset_mac_header(odev->skb_rx_buf);
945
946 /* Ship it off to the kernel */
947 netif_rx(odev->skb_rx_buf);

--- 293 unchanged lines hidden (view full) ---

1241 return;
1242 }
1243}
1244
1245/*
1246 * This needs to be a tasklet otherwise we will
1247 * end up recursively calling this function.
1248 */
1250void hso_unthrottle_tasklet(struct hso_serial *serial)
1249static void hso_unthrottle_tasklet(struct hso_serial *serial)
1251{
1252 unsigned long flags;
1253
1254 spin_lock_irqsave(&serial->serial_lock, flags);
1255 if ((serial->parent->port_spec & HSO_INTF_MUX))
1256 put_rxbuf_data_and_resubmit_ctrl_urb(serial);
1257 else
1258 put_rxbuf_data_and_resubmit_bulk_urb(serial);
1259 spin_unlock_irqrestore(&serial->serial_lock, flags);
1260}
1261
1262static void hso_unthrottle(struct tty_struct *tty)
1263{
1264 struct hso_serial *serial = get_serial_by_tty(tty);
1265
1266 tasklet_hi_schedule(&serial->unthrottle_tasklet);
1267}
1268
1250{
1251 unsigned long flags;
1252
1253 spin_lock_irqsave(&serial->serial_lock, flags);
1254 if ((serial->parent->port_spec & HSO_INTF_MUX))
1255 put_rxbuf_data_and_resubmit_ctrl_urb(serial);
1256 else
1257 put_rxbuf_data_and_resubmit_bulk_urb(serial);
1258 spin_unlock_irqrestore(&serial->serial_lock, flags);
1259}
1260
1261static void hso_unthrottle(struct tty_struct *tty)
1262{
1263 struct hso_serial *serial = get_serial_by_tty(tty);
1264
1265 tasklet_hi_schedule(&serial->unthrottle_tasklet);
1266}
1267
1269void hso_unthrottle_workfunc(struct work_struct *work)
1268static void hso_unthrottle_workfunc(struct work_struct *work)
1270{
1271 struct hso_serial *serial =
1272 container_of(work, struct hso_serial,
1273 retry_unthrottle_workqueue);
1274 hso_unthrottle_tasklet(serial);
1275}
1276
1277/* open the requested serial port */

--- 182 unchanged lines hidden (view full) ---

1460 return 0;
1461
1462 spin_lock_irqsave(&serial->serial_lock, flags);
1463 chars = serial->tx_buffer_count;
1464 spin_unlock_irqrestore(&serial->serial_lock, flags);
1465
1466 return chars;
1467}
1269{
1270 struct hso_serial *serial =
1271 container_of(work, struct hso_serial,
1272 retry_unthrottle_workqueue);
1273 hso_unthrottle_tasklet(serial);
1274}
1275
1276/* open the requested serial port */

--- 182 unchanged lines hidden (view full) ---

1459 return 0;
1460
1461 spin_lock_irqsave(&serial->serial_lock, flags);
1462 chars = serial->tx_buffer_count;
1463 spin_unlock_irqrestore(&serial->serial_lock, flags);
1464
1465 return chars;
1466}
1468int tiocmget_submit_urb(struct hso_serial *serial,
1469 struct hso_tiocmget *tiocmget,
1470 struct usb_device *usb)
1467static int tiocmget_submit_urb(struct hso_serial *serial,
1468 struct hso_tiocmget *tiocmget,
1469 struct usb_device *usb)
1471{
1472 int result;
1473
1474 if (serial->parent->usb_gone)
1475 return -ENODEV;
1476 usb_fill_int_urb(tiocmget->urb, usb,
1477 usb_rcvintpipe(usb,
1478 tiocmget->endp->

--- 1867 unchanged lines hidden ---
1470{
1471 int result;
1472
1473 if (serial->parent->usb_gone)
1474 return -ENODEV;
1475 usb_fill_int_urb(tiocmget->urb, usb,
1476 usb_rcvintpipe(usb,
1477 tiocmget->endp->

--- 1867 unchanged lines hidden ---