Lines Matching refs:hso_dev
324 struct hso_device *hso_dev);
329 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags);
330 static int hso_stop_serial_device(struct hso_device *hso_dev);
331 static int hso_start_net_device(struct hso_device *hso_dev);
333 static int hso_stop_net_device(struct hso_device *hso_dev);
339 static int hso_put_activity(struct hso_device *hso_dev);
340 static int hso_get_activity(struct hso_device *hso_dev);
348 static inline struct hso_net *dev2net(struct hso_device *hso_dev) in dev2net() argument
350 return hso_dev->port_data.dev_net; in dev2net()
353 static inline struct hso_serial *dev2ser(struct hso_device *hso_dev) in dev2ser() argument
355 return hso_dev->port_data.dev_serial; in dev2ser()
488 struct hso_device *hso_dev = dev_get_drvdata(dev); in hso_sysfs_show_porttype() local
491 if (!hso_dev) in hso_sysfs_show_porttype()
494 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_sysfs_show_porttype()
669 struct hso_device *hso_dev) in handle_usb_error() argument
703 if (hso_dev) in handle_usb_error()
704 usb_queue_reset_device(hso_dev->interface); in handle_usb_error()
2059 static void hso_log_port(struct hso_device *hso_dev) in hso_log_port() argument
2064 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_log_port()
2099 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { in hso_log_port()
2100 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name); in hso_log_port()
2103 dev2ser(hso_dev)->minor); in hso_log_port()
2105 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n", in hso_log_port()
2109 static int hso_start_net_device(struct hso_device *hso_dev) in hso_start_net_device() argument
2112 struct hso_net *hso_net = dev2net(hso_dev); in hso_start_net_device()
2122 hso_dev->usb, in hso_start_net_device()
2123 usb_rcvbulkpipe(hso_dev->usb, in hso_start_net_device()
2134 dev_warn(&hso_dev->usb->dev, in hso_start_net_device()
2142 static int hso_stop_net_device(struct hso_device *hso_dev) in hso_stop_net_device() argument
2145 struct hso_net *hso_net = dev2net(hso_dev); in hso_stop_net_device()
2161 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags) in hso_start_serial_device() argument
2164 struct hso_serial *serial = dev2ser(hso_dev); in hso_start_serial_device()
2196 hso_dev->usb, flags); in hso_start_serial_device()
2208 static int hso_stop_serial_device(struct hso_device *hso_dev) in hso_stop_serial_device() argument
2211 struct hso_serial *serial = dev2ser(hso_dev); in hso_stop_serial_device()
2346 struct hso_device *hso_dev; in hso_create_device() local
2348 hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC); in hso_create_device()
2349 if (!hso_dev) in hso_create_device()
2352 hso_dev->port_spec = port_spec; in hso_create_device()
2353 hso_dev->usb = interface_to_usbdev(intf); in hso_create_device()
2354 hso_dev->interface = intf; in hso_create_device()
2355 kref_init(&hso_dev->ref); in hso_create_device()
2356 mutex_init(&hso_dev->mutex); in hso_create_device()
2358 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); in hso_create_device()
2359 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); in hso_create_device()
2361 return hso_dev; in hso_create_device()
2365 static int remove_net_device(struct hso_device *hso_dev) in remove_net_device() argument
2370 if (network_table[i] == hso_dev) { in remove_net_device()
2381 static void hso_free_net_device(struct hso_device *hso_dev) in hso_free_net_device() argument
2384 struct hso_net *hso_net = dev2net(hso_dev); in hso_free_net_device()
2407 kfree(hso_dev); in hso_free_net_device()
2438 static int add_net_device(struct hso_device *hso_dev) in add_net_device() argument
2444 network_table[i] = hso_dev; in add_net_device()
2455 struct hso_device *hso_dev = data; in hso_rfkill_set_block() local
2459 mutex_lock(&hso_dev->mutex); in hso_rfkill_set_block()
2460 if (hso_dev->usb_gone) in hso_rfkill_set_block()
2463 rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0), in hso_rfkill_set_block()
2466 mutex_unlock(&hso_dev->mutex); in hso_rfkill_set_block()
2475 static void hso_create_rfkill(struct hso_device *hso_dev, in hso_create_rfkill() argument
2478 struct hso_net *hso_net = dev2net(hso_dev); in hso_create_rfkill()
2488 &hso_rfkill_ops, hso_dev); in hso_create_rfkill()
2512 struct hso_device *hso_dev; in hso_create_net_device() local
2514 hso_dev = hso_create_device(interface, port_spec); in hso_create_net_device()
2515 if (!hso_dev) in hso_create_net_device()
2529 hso_dev->port_data.dev_net = hso_net; in hso_create_net_device()
2531 hso_net->parent = hso_dev; in hso_create_net_device()
2576 add_net_device(hso_dev); in hso_create_net_device()
2578 hso_log_port(hso_dev); in hso_create_net_device()
2580 hso_create_rfkill(hso_dev, interface); in hso_create_net_device()
2582 return hso_dev; in hso_create_net_device()
2584 hso_free_net_device(hso_dev); in hso_create_net_device()
2603 static void hso_free_serial_device(struct hso_device *hso_dev) in hso_free_serial_device() argument
2605 struct hso_serial *serial = dev2ser(hso_dev); in hso_free_serial_device()
2621 kfree(hso_dev); in hso_free_serial_device()
2628 struct hso_device *hso_dev; in hso_create_bulk_serial_device() local
2633 hso_dev = hso_create_device(interface, port); in hso_create_bulk_serial_device()
2634 if (!hso_dev) in hso_create_bulk_serial_device()
2641 serial->parent = hso_dev; in hso_create_bulk_serial_device()
2642 hso_dev->port_data.dev_serial = serial; in hso_create_bulk_serial_device()
2692 hso_log_port(hso_dev); in hso_create_bulk_serial_device()
2695 return hso_dev; in hso_create_bulk_serial_device()
2703 kfree(hso_dev); in hso_create_bulk_serial_device()
2713 struct hso_device *hso_dev; in hso_create_mux_serial_device() local
2724 hso_dev = hso_create_device(interface, port_spec); in hso_create_mux_serial_device()
2725 if (!hso_dev) in hso_create_mux_serial_device()
2732 hso_dev->port_data.dev_serial = serial; in hso_create_mux_serial_device()
2733 serial->parent = hso_dev; in hso_create_mux_serial_device()
2751 hso_log_port(hso_dev); in hso_create_mux_serial_device()
2754 return hso_dev; in hso_create_mux_serial_device()
2761 kfree(hso_dev); in hso_create_mux_serial_device()
2885 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()