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;
463 struct hso_device *hso_dev = dev_get_drvdata(dev);
466 if (!hso_dev)
469 switch (hso_dev->port_spec & HSO_PORT_MASK) {
643 struct hso_device *hso_dev)
677 if (hso_dev)
678 usb_queue_reset_device(hso_dev->interface);
2032 static void hso_log_port(struct hso_device *hso_dev)
2037 switch (hso_dev->port_spec & HSO_PORT_MASK) {
2072 if ((hso_dev->port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) {
2073 sprintf(port_dev, "%s", dev2net(hso_dev)->net->name);
2076 dev2ser(hso_dev)->minor);
2078 dev_dbg(&hso_dev->interface->dev, "HSO: Found %s port %s\n",
2082 static int hso_start_net_device(struct hso_device *hso_dev)
2085 struct hso_net *hso_net = dev2net(hso_dev);
2095 hso_dev->usb,
2096 usb_rcvbulkpipe(hso_dev->usb,
2107 dev_warn(&hso_dev->usb->dev,
2115 static int hso_stop_net_device(struct hso_device *hso_dev)
2118 struct hso_net *hso_net = dev2net(hso_dev);
2134 static int hso_start_serial_device(struct hso_device *hso_dev, gfp_t flags)
2137 struct hso_serial *serial = dev2ser(hso_dev);
2169 hso_dev->usb, flags);
2181 static int hso_stop_serial_device(struct hso_device *hso_dev)
2184 struct hso_serial *serial = dev2ser(hso_dev);
2315 struct hso_device *hso_dev;
2317 hso_dev = kzalloc(sizeof(*hso_dev), GFP_KERNEL);
2318 if (!hso_dev)
2321 hso_dev->port_spec = port_spec;
2322 hso_dev->usb = interface_to_usbdev(intf);
2323 hso_dev->interface = intf;
2324 kref_init(&hso_dev->ref);
2325 mutex_init(&hso_dev->mutex);
2327 INIT_WORK(&hso_dev->async_get_intf, async_get_intf);
2328 INIT_WORK(&hso_dev->async_put_intf, async_put_intf);
2330 return hso_dev;
2334 static int remove_net_device(struct hso_device *hso_dev)
2339 if (network_table[i] == hso_dev) {
2350 static void hso_free_net_device(struct hso_device *hso_dev)
2353 struct hso_net *hso_net = dev2net(hso_dev);
2376 kfree(hso_dev);
2407 static int add_net_device(struct hso_device *hso_dev)
2413 network_table[i] = hso_dev;
2424 struct hso_device *hso_dev = data;
2428 mutex_lock(&hso_dev->mutex);
2429 if (hso_dev->usb_gone)
2432 rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0),
2435 mutex_unlock(&hso_dev->mutex);
2444 static void hso_create_rfkill(struct hso_device *hso_dev,
2447 struct hso_net *hso_net = dev2net(hso_dev);
2457 &hso_rfkill_ops, hso_dev);
2480 struct hso_device *hso_dev;
2482 hso_dev = hso_create_device(interface, port_spec);
2483 if (!hso_dev)
2497 hso_dev->port_data.dev_net = hso_net;
2499 hso_net->parent = hso_dev;
2533 result = add_net_device(hso_dev);
2546 hso_log_port(hso_dev);
2548 hso_create_rfkill(hso_dev, interface);
2550 return hso_dev;
2553 remove_net_device(hso_dev);
2566 kfree(hso_dev);
2587 static void hso_free_serial_device(struct hso_device *hso_dev)
2589 struct hso_serial *serial = dev2ser(hso_dev);
2605 kfree(hso_dev);
2612 struct hso_device *hso_dev;
2617 hso_dev = hso_create_device(interface, port);
2618 if (!hso_dev)
2625 serial->parent = hso_dev;
2626 hso_dev->port_data.dev_serial = serial;
2679 hso_log_port(hso_dev);
2682 return hso_dev;
2690 kfree(hso_dev);
2700 struct hso_device *hso_dev;
2711 hso_dev = hso_create_device(interface, port_spec);
2712 if (!hso_dev)
2719 hso_dev->port_data.dev_serial = serial;
2720 serial->parent = hso_dev;
2735 hso_log_port(hso_dev);
2738 return hso_dev;
2743 kfree(hso_dev);
2871 struct hso_device *hso_dev = NULL;
2909 hso_dev = hso_create_net_device(interface,
2911 if (!hso_dev)
2913 tmp_dev = hso_dev;
2927 hso_dev = hso_create_mux_serial_device(
2929 if (!hso_dev)
2935 hso_dev = tmp_dev;
2942 hso_dev =
2945 hso_dev =
2948 if (!hso_dev)
2956 usb_set_intfdata(interface, hso_dev);
2976 struct hso_device *hso_dev =
2978 usb_autopm_get_interface(hso_dev->interface);
2983 struct hso_device *hso_dev =
2985 usb_autopm_put_interface(hso_dev->interface);
2988 static int hso_get_activity(struct hso_device *hso_dev)
2990 if (hso_dev->usb->state == USB_STATE_SUSPENDED) {
2991 if (!hso_dev->is_active) {
2992 hso_dev->is_active = 1;
2993 schedule_work(&hso_dev->async_get_intf);
2997 if (hso_dev->usb->state != USB_STATE_CONFIGURED)
3000 usb_mark_last_busy(hso_dev->usb);
3005 static int hso_put_activity(struct hso_device *hso_dev)
3007 if (hso_dev->usb->state != USB_STATE_SUSPENDED) {
3008 if (hso_dev->is_active) {
3009 hso_dev->is_active = 0;
3010 schedule_work(&hso_dev->async_put_intf);
3014 hso_dev->is_active = 0;
3094 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);
3096 hso_free_serial_device(hso_dev);