Lines Matching defs: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)
326 return hso_dev->port_data.dev_net;
329 static inline struct hso_serial *dev2ser(struct hso_device *hso_dev)
331 return hso_dev->port_data.dev_serial;
464 struct hso_device *hso_dev = dev_get_drvdata(dev);
467 if (!hso_dev)
470 switch (hso_dev->port_spec & HSO_PORT_MASK) {
644 struct hso_device *hso_dev)
678 if (hso_dev)
679 usb_queue_reset_device(hso_dev->interface);
2039 static void hso_log_port(struct hso_device *hso_dev)
2044 switch (hso_dev->port_spec & HSO_PORT_MASK) {
2079 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
2080 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name);
2083 dev2ser(hso_dev)->minor);
2085 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n",
2089 static int hso_start_net_device(struct hso_device *hso_dev)
2092 struct hso_net *hso_net = dev2net(hso_dev);
2102 hso_dev->usb,
2103 usb_rcvbulkpipe(hso_dev->usb,
2114 dev_warn(&hso_dev->usb->dev,
2122 static int hso_stop_net_device(struct hso_device *hso_dev)
2125 struct hso_net *hso_net = dev2net(hso_dev);
2141 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags)
2144 struct hso_serial *serial = dev2ser(hso_dev);
2176 hso_dev->usb, flags);
2188 static int hso_stop_serial_device(struct hso_device *hso_dev)
2191 struct hso_serial *serial = dev2ser(hso_dev);
2322 struct hso_device *hso_dev;
2324 hso_dev = kzalloc(sizeof(*hso_dev), GFP_ATOMIC);
2325 if (!hso_dev)
2328 hso_dev->port_spec = port_spec;
2329 hso_dev->usb = interface_to_usbdev(intf);
2330 hso_dev->interface = intf;
2331 kref_init(&hso_dev->ref);
2332 mutex_init(&hso_dev->mutex);
2334 INIT_WORK(&hso_dev->async_get_intf, async_get_intf);
2335 INIT_WORK(&hso_dev->async_put_intf, async_put_intf);
2337 return hso_dev;
2341 static int remove_net_device(struct hso_device *hso_dev)
2346 if (network_table[i] == hso_dev) {
2357 static void hso_free_net_device(struct hso_device *hso_dev)
2360 struct hso_net *hso_net = dev2net(hso_dev);
2383 kfree(hso_dev);
2414 static int add_net_device(struct hso_device *hso_dev)
2420 network_table[i] = hso_dev;
2431 struct hso_device *hso_dev = data;
2435 mutex_lock(&hso_dev->mutex);
2436 if (hso_dev->usb_gone)
2439 rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0),
2442 mutex_unlock(&hso_dev->mutex);
2451 static void hso_create_rfkill(struct hso_device *hso_dev,
2454 struct hso_net *hso_net = dev2net(hso_dev);
2464 &hso_rfkill_ops, hso_dev);
2487 struct hso_device *hso_dev;
2489 hso_dev = hso_create_device(interface, port_spec);
2490 if (!hso_dev)
2504 hso_dev->port_data.dev_net = hso_net;
2506 hso_net->parent = hso_dev;
2540 result = add_net_device(hso_dev);
2553 hso_log_port(hso_dev);
2555 hso_create_rfkill(hso_dev, interface);
2557 return hso_dev;
2560 remove_net_device(hso_dev);
2573 kfree(hso_dev);
2594 static void hso_free_serial_device(struct hso_device *hso_dev)
2596 struct hso_serial *serial = dev2ser(hso_dev);
2612 kfree(hso_dev);
2619 struct hso_device *hso_dev;
2624 hso_dev = hso_create_device(interface, port);
2625 if (!hso_dev)
2632 serial->parent = hso_dev;
2633 hso_dev->port_data.dev_serial = serial;
2686 hso_log_port(hso_dev);
2689 return hso_dev;
2697 kfree(hso_dev);
2707 struct hso_device *hso_dev;
2718 hso_dev = hso_create_device(interface, port_spec);
2719 if (!hso_dev)
2726 hso_dev->port_data.dev_serial = serial;
2727 serial->parent = hso_dev;
2742 hso_log_port(hso_dev);
2745 return hso_dev;
2750 kfree(hso_dev);
2878 struct hso_device *hso_dev = NULL;
2916 hso_dev = hso_create_net_device(interface,
2918 if (!hso_dev)
2920 tmp_dev = hso_dev;
2934 hso_dev = hso_create_mux_serial_device(
2936 if (!hso_dev)
2942 hso_dev = tmp_dev;
2949 hso_dev =
2952 hso_dev =
2955 if (!hso_dev)
2963 usb_set_intfdata(interface, hso_dev);
2983 struct hso_device *hso_dev =
2985 usb_autopm_get_interface(hso_dev->interface);
2990 struct hso_device *hso_dev =
2992 usb_autopm_put_interface(hso_dev->interface);
2995 static int hso_get_activity(struct hso_device *hso_dev)
2997 if (hso_dev->usb->state == USB_STATE_SUSPENDED) {
2998 if (!hso_dev->is_active) {
2999 hso_dev->is_active = 1;
3000 schedule_work(&hso_dev->async_get_intf);
3004 if (hso_dev->usb->state != USB_STATE_CONFIGURED)
3007 usb_mark_last_busy(hso_dev->usb);
3012 static int hso_put_activity(struct hso_device *hso_dev)
3014 if (hso_dev->usb->state != USB_STATE_SUSPENDED) {
3015 if (hso_dev->is_active) {
3016 hso_dev->is_active = 0;
3017 schedule_work(&hso_dev->async_put_intf);
3021 hso_dev->is_active = 0;
3101 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);
3103 hso_free_serial_device(hso_dev);