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()
2037 static void hso_log_port(struct hso_device *hso_dev) in hso_log_port() argument
2042 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_log_port()
2077 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { in hso_log_port()
2078 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name); in hso_log_port()
2081 dev2ser(hso_dev)->minor); in hso_log_port()
2083 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n", in hso_log_port()
2087 static int hso_start_net_device(struct hso_device *hso_dev) in hso_start_net_device() argument
2090 struct hso_net *hso_net = dev2net(hso_dev); in hso_start_net_device()
2100 hso_dev->usb, in hso_start_net_device()
2101 usb_rcvbulkpipe(hso_dev->usb, in hso_start_net_device()
2112 dev_warn(&hso_dev->usb->dev, in hso_start_net_device()
2120 static int hso_stop_net_device(struct hso_device *hso_dev) in hso_stop_net_device() argument
2123 struct hso_net *hso_net = dev2net(hso_dev); in hso_stop_net_device()
2139 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags) in hso_start_serial_device() argument
2142 struct hso_serial *serial = dev2ser(hso_dev); in hso_start_serial_device()
2174 hso_dev->usb, flags); in hso_start_serial_device()
2186 static int hso_stop_serial_device(struct hso_device *hso_dev) in hso_stop_serial_device() argument
2189 struct hso_serial *serial = dev2ser(hso_dev); in hso_stop_serial_device()
2320 struct hso_device *hso_dev; in hso_create_device() local
2322 hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC); in hso_create_device()
2323 if (!hso_dev) in hso_create_device()
2326 hso_dev->port_spec = port_spec; in hso_create_device()
2327 hso_dev->usb = interface_to_usbdev(intf); in hso_create_device()
2328 hso_dev->interface = intf; in hso_create_device()
2329 kref_init(&hso_dev->ref); in hso_create_device()
2330 mutex_init(&hso_dev->mutex); in hso_create_device()
2332 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); in hso_create_device()
2333 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); in hso_create_device()
2335 return hso_dev; in hso_create_device()
2339 static int remove_net_device(struct hso_device *hso_dev) in remove_net_device() argument
2344 if (network_table[i] == hso_dev) { in remove_net_device()
2355 static void hso_free_net_device(struct hso_device *hso_dev) in hso_free_net_device() argument
2358 struct hso_net *hso_net = dev2net(hso_dev); in hso_free_net_device()
2381 kfree(hso_dev); in hso_free_net_device()
2412 static int add_net_device(struct hso_device *hso_dev) in add_net_device() argument
2418 network_table[i] = hso_dev; in add_net_device()
2429 struct hso_device *hso_dev = data; in hso_rfkill_set_block() local
2433 mutex_lock(&hso_dev->mutex); in hso_rfkill_set_block()
2434 if (hso_dev->usb_gone) in hso_rfkill_set_block()
2437 rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0), in hso_rfkill_set_block()
2440 mutex_unlock(&hso_dev->mutex); in hso_rfkill_set_block()
2449 static void hso_create_rfkill(struct hso_device *hso_dev, in hso_create_rfkill() argument
2452 struct hso_net *hso_net = dev2net(hso_dev); in hso_create_rfkill()
2462 &hso_rfkill_ops, hso_dev); in hso_create_rfkill()
2485 struct hso_device *hso_dev; in hso_create_net_device() local
2487 hso_dev = hso_create_device(interface, port_spec); in hso_create_net_device()
2488 if (!hso_dev) in hso_create_net_device()
2502 hso_dev->port_data.dev_net = hso_net; in hso_create_net_device()
2504 hso_net->parent = hso_dev; in hso_create_net_device()
2538 result = add_net_device(hso_dev); in hso_create_net_device()
2551 hso_log_port(hso_dev); in hso_create_net_device()
2553 hso_create_rfkill(hso_dev, interface); in hso_create_net_device()
2555 return hso_dev; in hso_create_net_device()
2558 remove_net_device(hso_dev); in hso_create_net_device()
2571 kfree(hso_dev); in hso_create_net_device()
2592 static void hso_free_serial_device(struct hso_device *hso_dev) in hso_free_serial_device() argument
2594 struct hso_serial *serial = dev2ser(hso_dev); in hso_free_serial_device()
2610 kfree(hso_dev); in hso_free_serial_device()
2617 struct hso_device *hso_dev; in hso_create_bulk_serial_device() local
2622 hso_dev = hso_create_device(interface, port); in hso_create_bulk_serial_device()
2623 if (!hso_dev) in hso_create_bulk_serial_device()
2630 serial->parent = hso_dev; in hso_create_bulk_serial_device()
2631 hso_dev->port_data.dev_serial = serial; in hso_create_bulk_serial_device()
2684 hso_log_port(hso_dev); in hso_create_bulk_serial_device()
2687 return hso_dev; in hso_create_bulk_serial_device()
2695 kfree(hso_dev); in hso_create_bulk_serial_device()
2705 struct hso_device *hso_dev; in hso_create_mux_serial_device() local
2716 hso_dev = hso_create_device(interface, port_spec); in hso_create_mux_serial_device()
2717 if (!hso_dev) in hso_create_mux_serial_device()
2724 hso_dev->port_data.dev_serial = serial; in hso_create_mux_serial_device()
2725 serial->parent = hso_dev; in hso_create_mux_serial_device()
2740 hso_log_port(hso_dev); in hso_create_mux_serial_device()
2743 return hso_dev; in hso_create_mux_serial_device()
2748 kfree(hso_dev); in hso_create_mux_serial_device()
2876 struct hso_device *hso_dev = NULL; in hso_probe() local
2914 hso_dev = hso_create_net_device(interface, in hso_probe()
2916 if (!hso_dev) in hso_probe()
2918 tmp_dev = hso_dev; in hso_probe()
2932 hso_dev = hso_create_mux_serial_device( in hso_probe()
2934 if (!hso_dev) in hso_probe()
2940 hso_dev = tmp_dev; in hso_probe()
2947 hso_dev = in hso_probe()
2950 hso_dev = in hso_probe()
2953 if (!hso_dev) in hso_probe()
2961 usb_set_intfdata(interface, hso_dev); in hso_probe()
2981 struct hso_device *hso_dev = in async_get_intf() local
2983 usb_autopm_get_interface(hso_dev->interface); in async_get_intf()
2988 struct hso_device *hso_dev = in async_put_intf() local
2990 usb_autopm_put_interface(hso_dev->interface); in async_put_intf()
2993 static int hso_get_activity(struct hso_device *hso_dev) in hso_get_activity() argument
2995 if (hso_dev->usb->state == USB_STATE_SUSPENDED) { in hso_get_activity()
2996 if (!hso_dev->is_active) { in hso_get_activity()
2997 hso_dev->is_active = 1; in hso_get_activity()
2998 schedule_work(&hso_dev->async_get_intf); in hso_get_activity()
3002 if (hso_dev->usb->state != USB_STATE_CONFIGURED) in hso_get_activity()
3005 usb_mark_last_busy(hso_dev->usb); in hso_get_activity()
3010 static int hso_put_activity(struct hso_device *hso_dev) in hso_put_activity() argument
3012 if (hso_dev->usb->state != USB_STATE_SUSPENDED) { in hso_put_activity()
3013 if (hso_dev->is_active) { in hso_put_activity()
3014 hso_dev->is_active = 0; in hso_put_activity()
3015 schedule_work(&hso_dev->async_put_intf); in hso_put_activity()
3019 hso_dev->is_active = 0; in hso_put_activity()
3099 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); in hso_serial_ref_free() local
3101 hso_free_serial_device(hso_dev); in hso_serial_ref_free()