hso.c (de65d816aa44f9ddd79861ae21d75010cc1fd003) hso.c (38673c8218a6bcaac97b0243089e33617e28f43f)
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 * Jan Dumon <j.dumon@option.com>

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

2312 if (!serial->rx_urb[i]) {
2313 dev_err(dev, "Could not allocate urb?\n");
2314 goto exit;
2315 }
2316 serial->rx_urb[i]->transfer_buffer = NULL;
2317 serial->rx_urb[i]->transfer_buffer_length = 0;
2318 serial->rx_data[i] = kzalloc(serial->rx_data_length,
2319 GFP_KERNEL);
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 * Jan Dumon <j.dumon@option.com>

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

2312 if (!serial->rx_urb[i]) {
2313 dev_err(dev, "Could not allocate urb?\n");
2314 goto exit;
2315 }
2316 serial->rx_urb[i]->transfer_buffer = NULL;
2317 serial->rx_urb[i]->transfer_buffer_length = 0;
2318 serial->rx_data[i] = kzalloc(serial->rx_data_length,
2319 GFP_KERNEL);
2320 if (!serial->rx_data[i]) {
2321 dev_err(dev, "%s - Out of memory\n", __func__);
2320 if (!serial->rx_data[i])
2322 goto exit;
2321 goto exit;
2323 }
2324 }
2325
2326 /* TX, allocate urb and initialize */
2327 serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
2328 if (!serial->tx_urb) {
2329 dev_err(dev, "Could not allocate urb?\n");
2330 goto exit;
2331 }
2332 serial->tx_urb->transfer_buffer = NULL;
2333 serial->tx_urb->transfer_buffer_length = 0;
2334 /* prepare our TX buffer */
2335 serial->tx_data_count = 0;
2336 serial->tx_buffer_count = 0;
2337 serial->tx_data_length = tx_size;
2338 serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL);
2322 }
2323
2324 /* TX, allocate urb and initialize */
2325 serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL);
2326 if (!serial->tx_urb) {
2327 dev_err(dev, "Could not allocate urb?\n");
2328 goto exit;
2329 }
2330 serial->tx_urb->transfer_buffer = NULL;
2331 serial->tx_urb->transfer_buffer_length = 0;
2332 /* prepare our TX buffer */
2333 serial->tx_data_count = 0;
2334 serial->tx_buffer_count = 0;
2335 serial->tx_data_length = tx_size;
2336 serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL);
2339 if (!serial->tx_data) {
2340 dev_err(dev, "%s - Out of memory\n", __func__);
2337 if (!serial->tx_data)
2341 goto exit;
2338 goto exit;
2342 }
2339
2343 serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL);
2340 serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL);
2344 if (!serial->tx_buffer) {
2345 dev_err(dev, "%s - Out of memory\n", __func__);
2341 if (!serial->tx_buffer)
2346 goto exit;
2342 goto exit;
2347 }
2348
2349 return 0;
2350exit:
2351 hso_serial_common_free(serial);
2352 return -1;
2353}
2354
2355/* Creates a general hso device */

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

2575 for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
2576 hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
2577 if (!hso_net->mux_bulk_rx_urb_pool[i]) {
2578 dev_err(&interface->dev, "Could not allocate rx urb\n");
2579 goto exit;
2580 }
2581 hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
2582 GFP_KERNEL);
2343
2344 return 0;
2345exit:
2346 hso_serial_common_free(serial);
2347 return -1;
2348}
2349
2350/* Creates a general hso device */

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

2570 for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) {
2571 hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL);
2572 if (!hso_net->mux_bulk_rx_urb_pool[i]) {
2573 dev_err(&interface->dev, "Could not allocate rx urb\n");
2574 goto exit;
2575 }
2576 hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE,
2577 GFP_KERNEL);
2583 if (!hso_net->mux_bulk_rx_buf_pool[i]) {
2584 dev_err(&interface->dev, "Could not allocate rx buf\n");
2578 if (!hso_net->mux_bulk_rx_buf_pool[i])
2585 goto exit;
2579 goto exit;
2586 }
2587 }
2588 hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
2589 if (!hso_net->mux_bulk_tx_urb) {
2590 dev_err(&interface->dev, "Could not allocate tx urb\n");
2591 goto exit;
2592 }
2593 hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
2580 }
2581 hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL);
2582 if (!hso_net->mux_bulk_tx_urb) {
2583 dev_err(&interface->dev, "Could not allocate tx urb\n");
2584 goto exit;
2585 }
2586 hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL);
2594 if (!hso_net->mux_bulk_tx_buf) {
2595 dev_err(&interface->dev, "Could not allocate tx buf\n");
2587 if (!hso_net->mux_bulk_tx_buf)
2596 goto exit;
2588 goto exit;
2597 }
2598
2599 add_net_device(hso_dev);
2600
2601 hso_log_port(hso_dev);
2602
2603 hso_create_rfkill(hso_dev, interface);
2604
2605 return hso_dev;

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

2813 mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL);
2814 if (!mux->shared_intr_urb) {
2815 dev_err(&interface->dev, "Could not allocate intr urb?\n");
2816 goto exit;
2817 }
2818 mux->shared_intr_buf =
2819 kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),
2820 GFP_KERNEL);
2589
2590 add_net_device(hso_dev);
2591
2592 hso_log_port(hso_dev);
2593
2594 hso_create_rfkill(hso_dev, interface);
2595
2596 return hso_dev;

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

2804 mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL);
2805 if (!mux->shared_intr_urb) {
2806 dev_err(&interface->dev, "Could not allocate intr urb?\n");
2807 goto exit;
2808 }
2809 mux->shared_intr_buf =
2810 kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),
2811 GFP_KERNEL);
2821 if (!mux->shared_intr_buf) {
2822 dev_err(&interface->dev, "Could not allocate intr buf?\n");
2812 if (!mux->shared_intr_buf)
2823 goto exit;
2813 goto exit;
2824 }
2825
2826 mutex_init(&mux->shared_int_lock);
2827
2828 return mux;
2829
2830exit:
2831 kfree(mux->shared_intr_buf);
2832 usb_free_urb(mux->shared_intr_urb);

--- 532 unchanged lines hidden ---
2814
2815 mutex_init(&mux->shared_int_lock);
2816
2817 return mux;
2818
2819exit:
2820 kfree(mux->shared_intr_buf);
2821 usb_free_urb(mux->shared_intr_urb);

--- 532 unchanged lines hidden ---