Lines Matching refs:hso_dev

300 			     struct hso_device *hso_dev);
305 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags);
306 static int hso_stop_serial_device(struct hso_device *hso_dev);
307 static int hso_start_net_device(struct hso_device *hso_dev);
309 static int hso_stop_net_device(struct hso_device *hso_dev);
315 static int hso_put_activity(struct hso_device *hso_dev);
316 static int hso_get_activity(struct hso_device *hso_dev);
324 static inline struct hso_net *dev2net(struct hso_device *hso_dev) in dev2net() argument
326 return hso_dev->port_data.dev_net; in dev2net()
329 static inline struct hso_serial *dev2ser(struct hso_device *hso_dev) in dev2ser() argument
331 return hso_dev->port_data.dev_serial; in dev2ser()
463 struct hso_device *hso_dev = dev_get_drvdata(dev); in hsotype_show() local
466 if (!hso_dev) in hsotype_show()
469 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hsotype_show()
643 struct hso_device *hso_dev) in handle_usb_error() argument
677 if (hso_dev) in handle_usb_error()
678 usb_queue_reset_device(hso_dev->interface); in handle_usb_error()
2038 static void hso_log_port(struct hso_device *hso_dev) in hso_log_port() argument
2043 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_log_port()
2078 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { in hso_log_port()
2079 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name); in hso_log_port()
2082 dev2ser(hso_dev)->minor); in hso_log_port()
2084 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n", in hso_log_port()
2088 static int hso_start_net_device(struct hso_device *hso_dev) in hso_start_net_device() argument
2091 struct hso_net *hso_net = dev2net(hso_dev); in hso_start_net_device()
2101 hso_dev->usb, in hso_start_net_device()
2102 usb_rcvbulkpipe(hso_dev->usb, in hso_start_net_device()
2113 dev_warn(&hso_dev->usb->dev, in hso_start_net_device()
2121 static int hso_stop_net_device(struct hso_device *hso_dev) in hso_stop_net_device() argument
2124 struct hso_net *hso_net = dev2net(hso_dev); in hso_stop_net_device()
2140 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags) in hso_start_serial_device() argument
2143 struct hso_serial *serial = dev2ser(hso_dev); in hso_start_serial_device()
2175 hso_dev->usb, flags); in hso_start_serial_device()
2187 static int hso_stop_serial_device(struct hso_device *hso_dev) in hso_stop_serial_device() argument
2190 struct hso_serial *serial = dev2ser(hso_dev); in hso_stop_serial_device()
2321 struct hso_device *hso_dev; in hso_create_device() local
2323 hso_dev = kzalloc(sizeof(*hso_dev), GFP_KERNEL); in hso_create_device()
2324 if (!hso_dev) in hso_create_device()
2327 hso_dev->port_spec = port_spec; in hso_create_device()
2328 hso_dev->usb = interface_to_usbdev(intf); in hso_create_device()
2329 hso_dev->interface = intf; in hso_create_device()
2330 kref_init(&hso_dev->ref); in hso_create_device()
2331 mutex_init(&hso_dev->mutex); in hso_create_device()
2333 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); in hso_create_device()
2334 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); in hso_create_device()
2336 return hso_dev; in hso_create_device()
2340 static int remove_net_device(struct hso_device *hso_dev) in remove_net_device() argument
2345 if (network_table[i] == hso_dev) { in remove_net_device()
2356 static void hso_free_net_device(struct hso_device *hso_dev) in hso_free_net_device() argument
2359 struct hso_net *hso_net = dev2net(hso_dev); in hso_free_net_device()
2382 kfree(hso_dev); in hso_free_net_device()
2413 static int add_net_device(struct hso_device *hso_dev) in add_net_device() argument
2419 network_table[i] = hso_dev; in add_net_device()
2430 struct hso_device *hso_dev = data; in hso_rfkill_set_block() local
2434 mutex_lock(&hso_dev->mutex); in hso_rfkill_set_block()
2435 if (hso_dev->usb_gone) in hso_rfkill_set_block()
2438 rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0), in hso_rfkill_set_block()
2441 mutex_unlock(&hso_dev->mutex); in hso_rfkill_set_block()
2450 static void hso_create_rfkill(struct hso_device *hso_dev, in hso_create_rfkill() argument
2453 struct hso_net *hso_net = dev2net(hso_dev); in hso_create_rfkill()
2463 &hso_rfkill_ops, hso_dev); in hso_create_rfkill()
2486 struct hso_device *hso_dev; in hso_create_net_device() local
2488 hso_dev = hso_create_device(interface, port_spec); in hso_create_net_device()
2489 if (!hso_dev) in hso_create_net_device()
2503 hso_dev->port_data.dev_net = hso_net; in hso_create_net_device()
2505 hso_net->parent = hso_dev; in hso_create_net_device()
2539 result = add_net_device(hso_dev); in hso_create_net_device()
2552 hso_log_port(hso_dev); in hso_create_net_device()
2554 hso_create_rfkill(hso_dev, interface); in hso_create_net_device()
2556 return hso_dev; in hso_create_net_device()
2559 remove_net_device(hso_dev); in hso_create_net_device()
2572 kfree(hso_dev); in hso_create_net_device()
2593 static void hso_free_serial_device(struct hso_device *hso_dev) in hso_free_serial_device() argument
2595 struct hso_serial *serial = dev2ser(hso_dev); in hso_free_serial_device()
2611 kfree(hso_dev); in hso_free_serial_device()
2618 struct hso_device *hso_dev; in hso_create_bulk_serial_device() local
2623 hso_dev = hso_create_device(interface, port); in hso_create_bulk_serial_device()
2624 if (!hso_dev) in hso_create_bulk_serial_device()
2631 serial->parent = hso_dev; in hso_create_bulk_serial_device()
2632 hso_dev->port_data.dev_serial = serial; in hso_create_bulk_serial_device()
2685 hso_log_port(hso_dev); in hso_create_bulk_serial_device()
2688 return hso_dev; in hso_create_bulk_serial_device()
2696 kfree(hso_dev); in hso_create_bulk_serial_device()
2706 struct hso_device *hso_dev; in hso_create_mux_serial_device() local
2717 hso_dev = hso_create_device(interface, port_spec); in hso_create_mux_serial_device()
2718 if (!hso_dev) in hso_create_mux_serial_device()
2725 hso_dev->port_data.dev_serial = serial; in hso_create_mux_serial_device()
2726 serial->parent = hso_dev; in hso_create_mux_serial_device()
2741 hso_log_port(hso_dev); in hso_create_mux_serial_device()
2744 return hso_dev; in hso_create_mux_serial_device()
2749 kfree(hso_dev); in hso_create_mux_serial_device()
2877 struct hso_device *hso_dev = NULL; in hso_probe() local
2915 hso_dev = hso_create_net_device(interface, in hso_probe()
2917 if (!hso_dev) in hso_probe()
2919 tmp_dev = hso_dev; in hso_probe()
2933 hso_dev = hso_create_mux_serial_device( in hso_probe()
2935 if (!hso_dev) in hso_probe()
2941 hso_dev = tmp_dev; in hso_probe()
2948 hso_dev = in hso_probe()
2951 hso_dev = in hso_probe()
2954 if (!hso_dev) in hso_probe()
2962 usb_set_intfdata(interface, hso_dev); in hso_probe()
2982 struct hso_device *hso_dev = in async_get_intf() local
2984 usb_autopm_get_interface(hso_dev->interface); in async_get_intf()
2989 struct hso_device *hso_dev = in async_put_intf() local
2991 usb_autopm_put_interface(hso_dev->interface); in async_put_intf()
2994 static int hso_get_activity(struct hso_device *hso_dev) in hso_get_activity() argument
2996 if (hso_dev->usb->state == USB_STATE_SUSPENDED) { in hso_get_activity()
2997 if (!hso_dev->is_active) { in hso_get_activity()
2998 hso_dev->is_active = 1; in hso_get_activity()
2999 schedule_work(&hso_dev->async_get_intf); in hso_get_activity()
3003 if (hso_dev->usb->state != USB_STATE_CONFIGURED) in hso_get_activity()
3006 usb_mark_last_busy(hso_dev->usb); in hso_get_activity()
3011 static int hso_put_activity(struct hso_device *hso_dev) in hso_put_activity() argument
3013 if (hso_dev->usb->state != USB_STATE_SUSPENDED) { in hso_put_activity()
3014 if (hso_dev->is_active) { in hso_put_activity()
3015 hso_dev->is_active = 0; in hso_put_activity()
3016 schedule_work(&hso_dev->async_put_intf); in hso_put_activity()
3020 hso_dev->is_active = 0; in hso_put_activity()
3100 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); in hso_serial_ref_free() local
3102 hso_free_serial_device(hso_dev); in hso_serial_ref_free()