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()
464 struct hso_device *hso_dev = dev_get_drvdata(dev); in hso_sysfs_show_porttype() local
467 if (!hso_dev) in hso_sysfs_show_porttype()
470 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_sysfs_show_porttype()
645 struct hso_device *hso_dev) in handle_usb_error() argument
679 if (hso_dev) in handle_usb_error()
680 usb_queue_reset_device(hso_dev->interface); in handle_usb_error()
2040 static void hso_log_port(struct hso_device *hso_dev) in hso_log_port() argument
2045 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_log_port()
2080 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { in hso_log_port()
2081 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name); in hso_log_port()
2084 dev2ser(hso_dev)->minor); in hso_log_port()
2086 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n", in hso_log_port()
2090 static int hso_start_net_device(struct hso_device *hso_dev) in hso_start_net_device() argument
2093 struct hso_net *hso_net = dev2net(hso_dev); in hso_start_net_device()
2103 hso_dev->usb, in hso_start_net_device()
2104 usb_rcvbulkpipe(hso_dev->usb, in hso_start_net_device()
2115 dev_warn(&hso_dev->usb->dev, in hso_start_net_device()
2123 static int hso_stop_net_device(struct hso_device *hso_dev) in hso_stop_net_device() argument
2126 struct hso_net *hso_net = dev2net(hso_dev); in hso_stop_net_device()
2142 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags) in hso_start_serial_device() argument
2145 struct hso_serial *serial = dev2ser(hso_dev); in hso_start_serial_device()
2177 hso_dev->usb, flags); in hso_start_serial_device()
2189 static int hso_stop_serial_device(struct hso_device *hso_dev) in hso_stop_serial_device() argument
2192 struct hso_serial *serial = dev2ser(hso_dev); in hso_stop_serial_device()
2324 struct hso_device *hso_dev; in hso_create_device() local
2326 hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC); in hso_create_device()
2327 if (!hso_dev) in hso_create_device()
2330 hso_dev->port_spec = port_spec; in hso_create_device()
2331 hso_dev->usb = interface_to_usbdev(intf); in hso_create_device()
2332 hso_dev->interface = intf; in hso_create_device()
2333 kref_init(&hso_dev->ref); in hso_create_device()
2334 mutex_init(&hso_dev->mutex); in hso_create_device()
2336 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); in hso_create_device()
2337 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); in hso_create_device()
2339 return hso_dev; in hso_create_device()
2343 static int remove_net_device(struct hso_device *hso_dev) in remove_net_device() argument
2348 if (network_table[i] == hso_dev) { in remove_net_device()
2359 static void hso_free_net_device(struct hso_device *hso_dev, bool bailout) in hso_free_net_device() argument
2362 struct hso_net *hso_net = dev2net(hso_dev); in hso_free_net_device()
2385 kfree(hso_dev); in hso_free_net_device()
2416 static int add_net_device(struct hso_device *hso_dev) in add_net_device() argument
2422 network_table[i] = hso_dev; in add_net_device()
2433 struct hso_device *hso_dev = data; in hso_rfkill_set_block() local
2437 mutex_lock(&hso_dev->mutex); in hso_rfkill_set_block()
2438 if (hso_dev->usb_gone) in hso_rfkill_set_block()
2441 rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0), in hso_rfkill_set_block()
2444 mutex_unlock(&hso_dev->mutex); in hso_rfkill_set_block()
2453 static void hso_create_rfkill(struct hso_device *hso_dev, in hso_create_rfkill() argument
2456 struct hso_net *hso_net = dev2net(hso_dev); in hso_create_rfkill()
2466 &hso_rfkill_ops, hso_dev); in hso_create_rfkill()
2489 struct hso_device *hso_dev; in hso_create_net_device() local
2491 hso_dev = hso_create_device(interface, port_spec); in hso_create_net_device()
2492 if (!hso_dev) in hso_create_net_device()
2506 hso_dev->port_data.dev_net = hso_net; in hso_create_net_device()
2508 hso_net->parent = hso_dev; in hso_create_net_device()
2542 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()
2557 hso_free_net_device(hso_dev, true); in hso_create_net_device()
2578 static void hso_free_serial_device(struct hso_device *hso_dev) in hso_free_serial_device() argument
2580 struct hso_serial *serial = dev2ser(hso_dev); in hso_free_serial_device()
2596 kfree(hso_dev); in hso_free_serial_device()
2603 struct hso_device *hso_dev; in hso_create_bulk_serial_device() local
2608 hso_dev = hso_create_device(interface, port); in hso_create_bulk_serial_device()
2609 if (!hso_dev) in hso_create_bulk_serial_device()
2616 serial->parent = hso_dev; in hso_create_bulk_serial_device()
2617 hso_dev->port_data.dev_serial = serial; in hso_create_bulk_serial_device()
2674 hso_log_port(hso_dev); in hso_create_bulk_serial_device()
2677 return hso_dev; in hso_create_bulk_serial_device()
2685 kfree(hso_dev); in hso_create_bulk_serial_device()
2695 struct hso_device *hso_dev; in hso_create_mux_serial_device() local
2706 hso_dev = hso_create_device(interface, port_spec); in hso_create_mux_serial_device()
2707 if (!hso_dev) in hso_create_mux_serial_device()
2714 hso_dev->port_data.dev_serial = serial; in hso_create_mux_serial_device()
2715 serial->parent = hso_dev; in hso_create_mux_serial_device()
2733 hso_log_port(hso_dev); in hso_create_mux_serial_device()
2736 return hso_dev; in hso_create_mux_serial_device()
2743 kfree(hso_dev); in hso_create_mux_serial_device()
2871 struct hso_device *hso_dev = NULL; in hso_probe() local
2909 hso_dev = hso_create_net_device(interface, in hso_probe()
2911 if (!hso_dev) in hso_probe()
2913 tmp_dev = hso_dev; in hso_probe()
2927 hso_dev = hso_create_mux_serial_device( in hso_probe()
2929 if (!hso_dev) in hso_probe()
2935 hso_dev = tmp_dev; in hso_probe()
2942 hso_dev = in hso_probe()
2945 hso_dev = in hso_probe()
2948 if (!hso_dev) in hso_probe()
2956 usb_set_intfdata(interface, hso_dev); in hso_probe()
2976 struct hso_device *hso_dev = in async_get_intf() local
2978 usb_autopm_get_interface(hso_dev->interface); in async_get_intf()
2983 struct hso_device *hso_dev = in async_put_intf() local
2985 usb_autopm_put_interface(hso_dev->interface); in async_put_intf()
2988 static int hso_get_activity(struct hso_device *hso_dev) in hso_get_activity() argument
2990 if (hso_dev->usb->state == USB_STATE_SUSPENDED) { in hso_get_activity()
2991 if (!hso_dev->is_active) { in hso_get_activity()
2992 hso_dev->is_active = 1; in hso_get_activity()
2993 schedule_work(&hso_dev->async_get_intf); in hso_get_activity()
2997 if (hso_dev->usb->state != USB_STATE_CONFIGURED) in hso_get_activity()
3000 usb_mark_last_busy(hso_dev->usb); in hso_get_activity()
3005 static int hso_put_activity(struct hso_device *hso_dev) in hso_put_activity() argument
3007 if (hso_dev->usb->state != USB_STATE_SUSPENDED) { in hso_put_activity()
3008 if (hso_dev->is_active) { in hso_put_activity()
3009 hso_dev->is_active = 0; in hso_put_activity()
3010 schedule_work(&hso_dev->async_put_intf); in hso_put_activity()
3014 hso_dev->is_active = 0; in hso_put_activity()
3094 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); in hso_serial_ref_free() local
3096 hso_free_serial_device(hso_dev); in hso_serial_ref_free()