login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
May
»
14
Re: HSO: add option hso driver
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Paulius Zaleckas
Subject:
Re: HSO: add option hso driver
Date: Wednesday, May 14, 2008 - 6:59 am
Greg Kroah-Hartman wrote:
quoted text
> +#define DRIVER_VERSION "1.2"
Maybe we should bump the version? Now it is the same as the different driver at PHARscape.
quoted text
> +/* called once for each interface upon device insertion */ > +static int hso_probe(struct usb_interface *interface, > + const struct usb_device_id *id) > +{ > + int mux, i, if_num, port_spec; > + unsigned char port_mask; > + struct hso_device *hso_dev = NULL; > + struct hso_shared_int *shared_int; > + struct hso_device *tmp_dev = NULL; > + > + if_num = interface->altsetting->desc.bInterfaceNumber; > + > + /* Get the interface/port specification from either driver_info or from > + * the device itself */ > + if (id->driver_info) > + port_spec = ((u32 *)(id->driver_info))[if_num]; > + else > + port_spec = hso_get_config_data(interface); > + > + if (interface->cur_altsetting->desc.bInterfaceClass != 0xFF) { > + dev_err(&interface->dev, "Not our interface\n"); > + return -ENODEV; > + } > + /* Check if we need to switch to alt interfaces prior to port > + * configuration */ > + if (interface->num_altsetting > 1) > + usb_set_interface(interface_to_usbdev(interface), if_num, 1); > + interface->needs_remote_wakeup = 1; > + > + /* Allocate new hso device(s) */ > + switch (port_spec & HSO_INTF_MASK) { > + case HSO_INTF_MUX: > + if ((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) { > + /* Create the network device */ > + if (!disable_net) { > + hso_dev = hso_create_net_device(interface); > + if (!hso_dev) > + goto exit; > + tmp_dev = hso_dev; > + } > + } > + > + if (hso_get_mux_ports(interface, &port_mask)) > + /* TODO: de-allocate everything */ > + goto exit; > + > + shared_int = hso_create_shared_int(interface); > + if (!shared_int) > + goto exit; > + > + for (i = 1, mux = 0; i < 0x100; i = i << 1, mux++) { > + if (port_mask & i) { > + hso_dev = hso_create_mux_serial_device( > + interface, i, shared_int); > + if (!hso_dev) > + goto exit; > + } > + } > + > + if (tmp_dev) > + hso_dev = tmp_dev; > + break; > + > + case HSO_INTF_BULK: > + /* It's a regular bulk interface */ > + if (((port_spec & HSO_PORT_MASK) == HSO_PORT_NETWORK) > + && !disable_net) > + hso_dev = hso_create_net_device(interface); > + else > + hso_dev = > + hso_create_bulk_serial_device(interface, port_spec); > + if (!hso_dev) > + goto exit; > + break; > + default: > + goto exit; > + } > + > + usb_driver_claim_interface(&hso_driver, interface, hso_dev);
Is usb_driver_claim_interface really needed?
quoted text
> + /* save our data pointer in this device */ > + usb_set_intfdata(interface, hso_dev); > + > + /* done */ > + return 0; > +exit: > + hso_free_interface(interface); > + return -ENODEV; > +}
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] HSO: add option hso driver
, Greg KH
, (Tue May 13, 2:51 pm)
Re: [PATCH] HSO: add option hso driver
, Alan Cox
, (Tue May 13, 3:27 pm)
Re: [PATCH] HSO: add option hso driver
, Jeff Garzik
, (Tue May 13, 4:26 pm)
Re: [PATCH] HSO: add option hso driver
, Greg KH
, (Tue May 13, 6:58 pm)
Re: [PATCH] HSO: add option hso driver
, Greg KH
, (Tue May 13, 9:52 pm)
HSO: add option hso driver
, Greg Kroah-Hartman
, (Tue May 13, 9:57 pm)
Re: HSO: add option hso driver
, Paulius Zaleckas
, (Wed May 14, 6:59 am)
Re: HSO: add option hso driver
, Filip Aben
, (Wed May 14, 8:12 am)
Re: [PATCH] HSO: add option hso driver
, Jan Engelhardt
, (Wed May 14, 8:58 am)
Re: HSO: add option hso driver
, Marcel Holtmann
, (Wed May 14, 10:36 am)
Re: HSO: add option hso driver
, Jeff Garzik
, (Wed Jun 11, 7:51 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Fortier,Vincent [Montreal]
2.6.21.5 june 30th to july 1st date hang?
Jeff Dike
[ PATCH 2/6 ] UML - Formatting fixes around os_{read_write}_file callers
Liam Girdwood
[PATCH 07/13] regulator: regulator test harness
Oleg Nesterov
Re: Getting the new RxRPC patches upstream
Stefan Seyfried
Re: 2.6.19-rc5: grub is much slower resuming from suspend-to-disk than in 2.6.18
linux-netdev
:
Arnaud Ebalard
Re: [REGRESSION,BISECTED] MIPv6 support broken by f4f914b58019f0
Jan Engelhardt
Re: [PATCH iptables] extension: add xt_cpu match
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Sebastian Andrzej Siewior
[PATCH 8/8] net/emergency: remove locking from reycling pool if emergncy pools are...
David Miller
Re: [PATCH] qlcnic: dont assume NET_IP_ALIGN is 2
git
:
Jakub Narebski
Re: git on MacOSX and files with decomposed utf-8 file names
Brandon Casey
Re: Thunderbird and patches (was Re: [PATCH v2] Enable setting attach as the def...
Christian Couder
[PATCH 1/3] rev-parse: add test script for "--verify"
Ramkumar Ramachandra
Re: [GSoC update] git-remote-svn: The final one
Junio C Hamano
Re: git-rm isn't the inverse action of git-add
openbsd-misc
:
Joachim Schipper
Re: UVC Webcams
Florin Andrei
SOLVED [was: firewall is very slow, something's wrong]
Todd Alan Smith
Re: Microsoft gets the Most Secure Operating Systems award
Neal Hogan
Re: Need Advice: Thinkpad T60 or T61?
Sam Fourman Jr.
Re: Real men don't attack straw men
git-commits-head
:
Linux Kernel Mailing List
ACPI: Disable ARB_DISABLE on platforms where it is not needed
Linux Kernel Mailing List
m68knommu: add read_barrier_depends() and irqs_disabled_flags()
Linux Kernel Mailing List
[MTD] Add mtd panic_write function pointer
Linux Kernel Mailing List
[ARM] pxa: remove duplicate select statements from Kconfig
Linux Kernel Mailing List
mlx4_core: Don't read reserved fields in mlx4_QUERY_ADAPTER()
Colocation donated by:
Syndicate