Lines Matching refs:hso_dev
314 struct hso_device *hso_dev);
319 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags);
320 static int hso_stop_serial_device(struct hso_device *hso_dev);
321 static int hso_start_net_device(struct hso_device *hso_dev);
323 static int hso_stop_net_device(struct hso_device *hso_dev);
329 static int hso_put_activity(struct hso_device *hso_dev);
330 static int hso_get_activity(struct hso_device *hso_dev);
338 static inline struct hso_net *dev2net(struct hso_device *hso_dev) in dev2net() argument
340 return hso_dev->port_data.dev_net; in dev2net()
343 static inline struct hso_serial *dev2ser(struct hso_device *hso_dev) in dev2ser() argument
345 return hso_dev->port_data.dev_serial; in dev2ser()
478 struct hso_device *hso_dev = dev_get_drvdata(dev); in hso_sysfs_show_porttype() local
481 if (!hso_dev) in hso_sysfs_show_porttype()
484 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_sysfs_show_porttype()
659 struct hso_device *hso_dev) in handle_usb_error() argument
693 if (hso_dev) in handle_usb_error()
694 usb_queue_reset_device(hso_dev->interface); in handle_usb_error()
2053 static void hso_log_port(struct hso_device *hso_dev) in hso_log_port() argument
2058 switch (hso_dev->port_spec & HSO_PORT_MASK) { in hso_log_port()
2093 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { in hso_log_port()
2094 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name); in hso_log_port()
2097 dev2ser(hso_dev)->minor); in hso_log_port()
2099 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n", in hso_log_port()
2103 static int hso_start_net_device(struct hso_device *hso_dev) in hso_start_net_device() argument
2106 struct hso_net *hso_net = dev2net(hso_dev); in hso_start_net_device()
2116 hso_dev->usb, in hso_start_net_device()
2117 usb_rcvbulkpipe(hso_dev->usb, in hso_start_net_device()
2128 dev_warn(&hso_dev->usb->dev, in hso_start_net_device()
2136 static int hso_stop_net_device(struct hso_device *hso_dev) in hso_stop_net_device() argument
2139 struct hso_net *hso_net = dev2net(hso_dev); in hso_stop_net_device()
2155 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags) in hso_start_serial_device() argument
2158 struct hso_serial *serial = dev2ser(hso_dev); in hso_start_serial_device()
2190 hso_dev->usb, flags); in hso_start_serial_device()
2202 static int hso_stop_serial_device(struct hso_device *hso_dev) in hso_stop_serial_device() argument
2205 struct hso_serial *serial = dev2ser(hso_dev); in hso_stop_serial_device()
2334 struct hso_device *hso_dev; in hso_create_device() local
2336 hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC); in hso_create_device()
2337 if (!hso_dev) in hso_create_device()
2340 hso_dev->port_spec = port_spec; in hso_create_device()
2341 hso_dev->usb = interface_to_usbdev(intf); in hso_create_device()
2342 hso_dev->interface = intf; in hso_create_device()
2343 kref_init(&hso_dev->ref); in hso_create_device()
2344 mutex_init(&hso_dev->mutex); in hso_create_device()
2346 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); in hso_create_device()
2347 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); in hso_create_device()
2349 return hso_dev; in hso_create_device()
2353 static int remove_net_device(struct hso_device *hso_dev) in remove_net_device() argument
2358 if (network_table[i] == hso_dev) { in remove_net_device()
2369 static void hso_free_net_device(struct hso_device *hso_dev) in hso_free_net_device() argument
2372 struct hso_net *hso_net = dev2net(hso_dev); in hso_free_net_device()
2395 kfree(hso_dev); in hso_free_net_device()
2426 static int add_net_device(struct hso_device *hso_dev) in add_net_device() argument
2432 network_table[i] = hso_dev; in add_net_device()
2443 struct hso_device *hso_dev = data; in hso_rfkill_set_block() local
2447 mutex_lock(&hso_dev->mutex); in hso_rfkill_set_block()
2448 if (hso_dev->usb_gone) in hso_rfkill_set_block()
2451 rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0), in hso_rfkill_set_block()
2454 mutex_unlock(&hso_dev->mutex); in hso_rfkill_set_block()
2463 static void hso_create_rfkill(struct hso_device *hso_dev, in hso_create_rfkill() argument
2466 struct hso_net *hso_net = dev2net(hso_dev); in hso_create_rfkill()
2476 &hso_rfkill_ops, hso_dev); in hso_create_rfkill()
2500 struct hso_device *hso_dev; in hso_create_net_device() local
2502 hso_dev = hso_create_device(interface, port_spec); in hso_create_net_device()
2503 if (!hso_dev) in hso_create_net_device()
2517 hso_dev->port_data.dev_net = hso_net; in hso_create_net_device()
2519 hso_net->parent = hso_dev; in hso_create_net_device()
2553 add_net_device(hso_dev); in hso_create_net_device()
2562 hso_log_port(hso_dev); in hso_create_net_device()
2564 hso_create_rfkill(hso_dev, interface); in hso_create_net_device()
2566 return hso_dev; in hso_create_net_device()
2568 hso_free_net_device(hso_dev); in hso_create_net_device()
2587 static void hso_free_serial_device(struct hso_device *hso_dev) in hso_free_serial_device() argument
2589 struct hso_serial *serial = dev2ser(hso_dev); in hso_free_serial_device()
2605 kfree(hso_dev); in hso_free_serial_device()
2612 struct hso_device *hso_dev; in hso_create_bulk_serial_device() local
2617 hso_dev = hso_create_device(interface, port); in hso_create_bulk_serial_device()
2618 if (!hso_dev) in hso_create_bulk_serial_device()
2625 serial->parent = hso_dev; in hso_create_bulk_serial_device()
2626 hso_dev->port_data.dev_serial = serial; in hso_create_bulk_serial_device()
2676 hso_log_port(hso_dev); in hso_create_bulk_serial_device()
2679 return hso_dev; in hso_create_bulk_serial_device()
2687 kfree(hso_dev); in hso_create_bulk_serial_device()
2697 struct hso_device *hso_dev; in hso_create_mux_serial_device() local
2708 hso_dev = hso_create_device(interface, port_spec); in hso_create_mux_serial_device()
2709 if (!hso_dev) in hso_create_mux_serial_device()
2716 hso_dev->port_data.dev_serial = serial; in hso_create_mux_serial_device()
2717 serial->parent = hso_dev; in hso_create_mux_serial_device()
2735 hso_log_port(hso_dev); in hso_create_mux_serial_device()
2738 return hso_dev; in hso_create_mux_serial_device()
2745 kfree(hso_dev); in hso_create_mux_serial_device()
2867 struct hso_device *hso_dev = NULL; in hso_probe() local
2897 hso_dev = hso_create_net_device(interface, in hso_probe()
2899 if (!hso_dev) in hso_probe()
2901 tmp_dev = hso_dev; in hso_probe()
2915 hso_dev = hso_create_mux_serial_device( in hso_probe()
2917 if (!hso_dev) in hso_probe()
2923 hso_dev = tmp_dev; in hso_probe()
2930 hso_dev = in hso_probe()
2933 hso_dev = in hso_probe()
2936 if (!hso_dev) in hso_probe()
2944 usb_set_intfdata(interface, hso_dev); in hso_probe()
2964 struct hso_device *hso_dev = in async_get_intf() local
2966 usb_autopm_get_interface(hso_dev->interface); in async_get_intf()
2971 struct hso_device *hso_dev = in async_put_intf() local
2973 usb_autopm_put_interface(hso_dev->interface); in async_put_intf()
2976 static int hso_get_activity(struct hso_device *hso_dev) in hso_get_activity() argument
2978 if (hso_dev->usb->state == USB_STATE_SUSPENDED) { in hso_get_activity()
2979 if (!hso_dev->is_active) { in hso_get_activity()
2980 hso_dev->is_active = 1; in hso_get_activity()
2981 schedule_work(&hso_dev->async_get_intf); in hso_get_activity()
2985 if (hso_dev->usb->state != USB_STATE_CONFIGURED) in hso_get_activity()
2988 usb_mark_last_busy(hso_dev->usb); in hso_get_activity()
2993 static int hso_put_activity(struct hso_device *hso_dev) in hso_put_activity() argument
2995 if (hso_dev->usb->state != USB_STATE_SUSPENDED) { in hso_put_activity()
2996 if (hso_dev->is_active) { in hso_put_activity()
2997 hso_dev->is_active = 0; in hso_put_activity()
2998 schedule_work(&hso_dev->async_put_intf); in hso_put_activity()
3002 hso_dev->is_active = 0; in hso_put_activity()
3082 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); in hso_serial_ref_free() local
3084 hso_free_serial_device(hso_dev); in hso_serial_ref_free()