Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
fa4229ad
Commit
fa4229ad
authored
Jan 12, 2003
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Plain Diff
Merge kroah.com:/home/greg/linux/BK/bleeding_edge-2.5
into kroah.com:/home/greg/linux/BK/gregkh-2.5
parents
29b49883
0c546aea
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
250 additions
and
290 deletions
+250
-290
Documentation/usb/proc_usb_info.txt
Documentation/usb/proc_usb_info.txt
+1
-1
drivers/usb/class/Kconfig
drivers/usb/class/Kconfig
+2
-2
drivers/usb/class/audio.c
drivers/usb/class/audio.c
+4
-4
drivers/usb/class/usb-midi.c
drivers/usb/class/usb-midi.c
+6
-6
drivers/usb/input/xpad.c
drivers/usb/input/xpad.c
+3
-1
drivers/usb/misc/speedtouch.c
drivers/usb/misc/speedtouch.c
+36
-165
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/digi_acceleport.c
+4
-2
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+1
-1
drivers/usb/serial/visor.c
drivers/usb/serial/visor.c
+148
-88
drivers/usb/serial/visor.h
drivers/usb/serial/visor.h
+30
-1
drivers/usb/storage/debug.c
drivers/usb/storage/debug.c
+14
-18
drivers/usb/usb-skeleton.c
drivers/usb/usb-skeleton.c
+1
-1
No files found.
Documentation/usb/proc_usb_info.txt
View file @
fa4229ad
...
@@ -23,7 +23,7 @@ and /proc/bus/usb/devices, as well as /proc/bus/usb/BBB/DDD files.
...
@@ -23,7 +23,7 @@ and /proc/bus/usb/devices, as well as /proc/bus/usb/BBB/DDD files.
to interact with USB devices.
to interact with USB devices.
There are a number of mount options supported by usbfs.
There are a number of mount options supported by usbfs.
Consult the source code (linux/drivers/usb/inode.c) for
Consult the source code (linux/drivers/usb/
core/
inode.c) for
information about those options.
information about those options.
**NOTE**: The filesystem has been renamed from "usbdevfs" to
**NOTE**: The filesystem has been renamed from "usbdevfs" to
...
...
drivers/usb/class/Kconfig
View file @
fa4229ad
...
@@ -27,8 +27,8 @@ config USB_BLUETOOTH_TTY
...
@@ -27,8 +27,8 @@ config USB_BLUETOOTH_TTY
device that can be used only by specialized Bluetooth HCI software.
device that can be used only by specialized Bluetooth HCI software.
Say Y here if you want to use OpenBT Bluetooth stack (available
Say Y here if you want to use OpenBT Bluetooth stack (available
at <http://developer.axis.com/software
/index.shtml>), or other TTY
at <http://developer.axis.com/software
>), or other TTY based
based
Bluetooth stacks, and want to connect a USB Bluetooth device
Bluetooth stacks, and want to connect a USB Bluetooth device
to your computer's USB port.
to your computer's USB port.
Do *not* enable this driver if you want to use generic Linux
Do *not* enable this driver if you want to use generic Linux
...
...
drivers/usb/class/audio.c
View file @
fa4229ad
...
@@ -1420,7 +1420,7 @@ static int usbout_start(struct usb_audiodev *as)
...
@@ -1420,7 +1420,7 @@ static int usbout_start(struct usb_audiodev *as)
urb
->
number_of_packets
=
DESCFRAMES
;
urb
->
number_of_packets
=
DESCFRAMES
;
urb
->
context
=
as
;
urb
->
context
=
as
;
urb
->
complete
=
usbout_completed
;
urb
->
complete
=
usbout_completed
;
if
(
!
usbout_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
KERNEL
))
if
(
!
usbout_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
ATOMIC
))
u
->
flags
|=
FLG_URB0RUNNING
;
u
->
flags
|=
FLG_URB0RUNNING
;
else
else
u
->
flags
&=
~
FLG_RUNNING
;
u
->
flags
&=
~
FLG_RUNNING
;
...
@@ -1433,7 +1433,7 @@ static int usbout_start(struct usb_audiodev *as)
...
@@ -1433,7 +1433,7 @@ static int usbout_start(struct usb_audiodev *as)
urb
->
number_of_packets
=
DESCFRAMES
;
urb
->
number_of_packets
=
DESCFRAMES
;
urb
->
context
=
as
;
urb
->
context
=
as
;
urb
->
complete
=
usbout_completed
;
urb
->
complete
=
usbout_completed
;
if
(
!
usbout_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
KERNEL
))
if
(
!
usbout_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
ATOMIC
))
u
->
flags
|=
FLG_URB1RUNNING
;
u
->
flags
|=
FLG_URB1RUNNING
;
else
else
u
->
flags
&=
~
FLG_RUNNING
;
u
->
flags
&=
~
FLG_RUNNING
;
...
@@ -1448,7 +1448,7 @@ static int usbout_start(struct usb_audiodev *as)
...
@@ -1448,7 +1448,7 @@ static int usbout_start(struct usb_audiodev *as)
urb
->
context
=
as
;
urb
->
context
=
as
;
urb
->
complete
=
usbout_sync_completed
;
urb
->
complete
=
usbout_sync_completed
;
/* stride: u->syncinterval */
/* stride: u->syncinterval */
if
(
!
usbout_sync_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
KERNEL
))
if
(
!
usbout_sync_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
ATOMIC
))
u
->
flags
|=
FLG_SYNC0RUNNING
;
u
->
flags
|=
FLG_SYNC0RUNNING
;
else
else
u
->
flags
&=
~
FLG_RUNNING
;
u
->
flags
&=
~
FLG_RUNNING
;
...
@@ -1462,7 +1462,7 @@ static int usbout_start(struct usb_audiodev *as)
...
@@ -1462,7 +1462,7 @@ static int usbout_start(struct usb_audiodev *as)
urb
->
context
=
as
;
urb
->
context
=
as
;
urb
->
complete
=
usbout_sync_completed
;
urb
->
complete
=
usbout_sync_completed
;
/* stride: u->syncinterval */
/* stride: u->syncinterval */
if
(
!
usbout_sync_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
KERNEL
))
if
(
!
usbout_sync_prepare_desc
(
u
,
urb
)
&&
!
usb_submit_urb
(
urb
,
GFP_
ATOMIC
))
u
->
flags
|=
FLG_SYNC1RUNNING
;
u
->
flags
|=
FLG_SYNC1RUNNING
;
else
else
u
->
flags
&=
~
FLG_RUNNING
;
u
->
flags
&=
~
FLG_RUNNING
;
...
...
drivers/usb/class/usb-midi.c
View file @
fa4229ad
...
@@ -337,7 +337,8 @@ static int usb_write( struct midi_out_endpoint *ep, unsigned char *buf, int len
...
@@ -337,7 +337,8 @@ static int usb_write( struct midi_out_endpoint *ep, unsigned char *buf, int len
if
(
status
)
{
if
(
status
)
{
printk
(
KERN_ERR
"usbmidi: Cannot submit urb (%d)
\n
"
,
status
);
printk
(
KERN_ERR
"usbmidi: Cannot submit urb (%d)
\n
"
,
status
);
ret
=
-
EFAULT
;
ret
=
-
EIO
;
goto
error
;
}
}
add_wait_queue
(
&
ep
->
wait
,
&
wait
);
add_wait_queue
(
&
ep
->
wait
,
&
wait
);
...
@@ -354,6 +355,7 @@ static int usb_write( struct midi_out_endpoint *ep, unsigned char *buf, int len
...
@@ -354,6 +355,7 @@ static int usb_write( struct midi_out_endpoint *ep, unsigned char *buf, int len
set_current_state
(
TASK_RUNNING
);
set_current_state
(
TASK_RUNNING
);
remove_wait_queue
(
&
ep
->
wait
,
&
wait
);
remove_wait_queue
(
&
ep
->
wait
,
&
wait
);
error:
return
ret
;
return
ret
;
}
}
...
@@ -369,7 +371,6 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
...
@@ -369,7 +371,6 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
struct
midi_in_endpoint
*
ep
=
(
struct
midi_in_endpoint
*
)(
urb
->
context
);
struct
midi_in_endpoint
*
ep
=
(
struct
midi_in_endpoint
*
)(
urb
->
context
);
unsigned
char
*
data
=
urb
->
transfer_buffer
;
unsigned
char
*
data
=
urb
->
transfer_buffer
;
int
i
,
j
,
wake
;
int
i
,
j
,
wake
;
unsigned
long
int
flags
;
if
(
!
ep
->
urbSubmitted
)
{
if
(
!
ep
->
urbSubmitted
)
{
return
;
return
;
...
@@ -377,7 +378,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
...
@@ -377,7 +378,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
if
(
(
urb
->
status
==
0
)
&&
(
urb
->
actual_length
>
0
)
)
{
if
(
(
urb
->
status
==
0
)
&&
(
urb
->
actual_length
>
0
)
)
{
wake
=
0
;
wake
=
0
;
spin_lock
_irqsave
(
&
ep
->
lock
,
flags
);
spin_lock
(
&
ep
->
lock
);
for
(
j
=
0
;
j
<
urb
->
actual_length
;
j
+=
4
)
{
for
(
j
=
0
;
j
<
urb
->
actual_length
;
j
+=
4
)
{
int
cin
=
(
data
[
j
]
>>
0
)
&
0xf
;
int
cin
=
(
data
[
j
]
>>
0
)
&
0xf
;
...
@@ -397,7 +398,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
...
@@ -397,7 +398,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
}
}
}
}
spin_unlock
_irqrestore
(
&
ep
->
lock
,
flags
);
spin_unlock
(
&
ep
->
lock
);
if
(
wake
)
{
if
(
wake
)
{
wake_up
(
&
ep
->
wait
);
wake_up
(
&
ep
->
wait
);
}
}
...
@@ -407,7 +408,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
...
@@ -407,7 +408,7 @@ static void usb_bulk_read(struct urb *urb, struct pt_regs *regs)
urb
->
dev
=
ep
->
usbdev
;
urb
->
dev
=
ep
->
usbdev
;
urb
->
actual_length
=
0
;
urb
->
actual_length
=
0
;
usb_submit_urb
(
urb
,
GFP_
KERNEL
);
usb_submit_urb
(
urb
,
GFP_
ATOMIC
);
}
}
...
@@ -855,7 +856,6 @@ static int usb_midi_open(struct inode *inode, struct file *file)
...
@@ -855,7 +856,6 @@ static int usb_midi_open(struct inode *inode, struct file *file)
add_wait_queue
(
&
open_wait
,
&
wait
);
add_wait_queue
(
&
open_wait
,
&
wait
);
up
(
&
open_sem
);
up
(
&
open_sem
);
schedule
();
schedule
();
__set_current_state
(
TASK_RUNNING
);
remove_wait_queue
(
&
open_wait
,
&
wait
);
remove_wait_queue
(
&
open_wait
,
&
wait
);
if
(
signal_pending
(
current
)
)
{
if
(
signal_pending
(
current
)
)
{
return
-
ERESTARTSYS
;
return
-
ERESTARTSYS
;
...
...
drivers/usb/input/xpad.c
View file @
fa4229ad
...
@@ -200,8 +200,10 @@ static int xpad_open (struct input_dev *dev)
...
@@ -200,8 +200,10 @@ static int xpad_open (struct input_dev *dev)
return
0
;
return
0
;
xpad
->
irq_in
->
dev
=
xpad
->
udev
;
xpad
->
irq_in
->
dev
=
xpad
->
udev
;
if
(
usb_submit_urb
(
xpad
->
irq_in
,
GFP_KERNEL
))
if
(
usb_submit_urb
(
xpad
->
irq_in
,
GFP_KERNEL
))
{
xpad
->
open_count
--
;
return
-
EIO
;
return
-
EIO
;
}
return
0
;
return
0
;
}
}
...
...
drivers/usb/misc/speedtouch.c
View file @
fa4229ad
This diff is collapsed.
Click to expand it.
drivers/usb/serial/digi_acceleport.c
View file @
fa4229ad
...
@@ -507,7 +507,8 @@ static struct usb_driver digi_driver = {
...
@@ -507,7 +507,8 @@ static struct usb_driver digi_driver = {
static
struct
usb_serial_device_type
digi_acceleport_2_device
=
{
static
struct
usb_serial_device_type
digi_acceleport_2_device
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
name
=
"Digi USB"
,
.
name
=
"Digi 2 port USB adapter"
,
.
short_name
=
"digi_2"
,
.
id_table
=
id_table_2
,
.
id_table
=
id_table_2
,
.
num_interrupt_in
=
0
,
.
num_interrupt_in
=
0
,
.
num_bulk_in
=
4
,
.
num_bulk_in
=
4
,
...
@@ -531,7 +532,8 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
...
@@ -531,7 +532,8 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
static
struct
usb_serial_device_type
digi_acceleport_4_device
=
{
static
struct
usb_serial_device_type
digi_acceleport_4_device
=
{
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
name
=
"Digi USB"
,
.
name
=
"Digi 4 port USB adapter"
,
.
short_name
=
"digi_4"
,
.
id_table
=
id_table_4
,
.
id_table
=
id_table_4
,
.
num_interrupt_in
=
0
,
.
num_interrupt_in
=
0
,
.
num_bulk_in
=
5
,
.
num_bulk_in
=
5
,
...
...
drivers/usb/serial/usb-serial.c
View file @
fa4229ad
...
@@ -910,7 +910,7 @@ int usb_serial_probe(struct usb_interface *interface,
...
@@ -910,7 +910,7 @@ int usb_serial_probe(struct usb_interface *interface,
kfree
(
serial
);
kfree
(
serial
);
return
-
EIO
;
return
-
EIO
;
}
}
retval
=
type
->
probe
(
serial
,
id
);
retval
=
type
->
probe
(
serial
,
id
_pattern
);
module_put
(
type
->
owner
);
module_put
(
type
->
owner
);
if
(
retval
<
0
)
{
if
(
retval
<
0
)
{
...
...
drivers/usb/serial/visor.c
View file @
fa4229ad
...
@@ -177,24 +177,40 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
...
@@ -177,24 +177,40 @@ static void visor_write_bulk_callback (struct urb *urb, struct pt_regs *regs);
static
void
visor_read_bulk_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
static
void
visor_read_bulk_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
static
void
visor_read_int_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
static
void
visor_read_int_callback
(
struct
urb
*
urb
,
struct
pt_regs
*
regs
);
static
int
clie_3_5_startup
(
struct
usb_serial
*
serial
);
static
int
clie_3_5_startup
(
struct
usb_serial
*
serial
);
static
int
palm_os_3_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
);
static
int
palm_os_4_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
);
static
struct
usb_device_id
id_table
[]
=
{
static
struct
usb_device_id
id_table
[]
=
{
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M500_ID
)
},
{
USB_DEVICE
(
HANDSPRING_VENDOR_ID
,
HANDSPRING_VISOR_ID
),
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M505_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_3_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M515_ID
)
},
{
USB_DEVICE
(
HANDSPRING_VENDOR_ID
,
HANDSPRING_TREO_ID
),
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_I705_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M125_ID
)
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M500_ID
),
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M130_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_TUNGSTEN_T_ID
)
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M505_ID
),
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_TUNGSTEN_Z_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_ZIRE_ID
)
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M515_ID
),
{
USB_DEVICE
(
HANDSPRING_VENDOR_ID
,
HANDSPRING_VISOR_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
HANDSPRING_VENDOR_ID
,
HANDSPRING_TREO_ID
)
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_I705_ID
),
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_0_ID
)
},
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_S360_ID
)
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M125_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M130_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_TUNGSTEN_T_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_TUNGSTEN_Z_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_ZIRE_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_0_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_S360_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_1_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_1_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_NX60_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_NX60_ID
),
.
driver_info
=
(
unsigned
int
)
&
palm_os_4_probe
},
{
}
/* Terminating entry */
{
}
/* Terminating entry */
};
};
...
@@ -600,101 +616,145 @@ static void visor_unthrottle (struct usb_serial_port *port)
...
@@ -600,101 +616,145 @@ static void visor_unthrottle (struct usb_serial_port *port)
dev_err
(
&
port
->
dev
,
"%s - failed submitting read urb, error %d
\n
"
,
__FUNCTION__
,
result
);
dev_err
(
&
port
->
dev
,
"%s - failed submitting read urb, error %d
\n
"
,
__FUNCTION__
,
result
);
}
}
static
int
visor
_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
)
static
int
palm_os_3
_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
)
{
{
struct
device
*
dev
=
&
serial
->
dev
->
dev
;
struct
device
*
dev
=
&
serial
->
dev
->
dev
;
int
response
;
struct
visor_connection_info
*
connection_info
;
unsigned
char
*
transfer_buffer
;
char
*
string
;
int
retval
=
0
;
int
i
;
int
i
;
int
num_ports
;
int
num_ports
;
unsigned
char
*
transfer_buffer
=
kmalloc
(
256
,
GFP_KERNEL
);
dbg
(
"%s"
,
__FUNCTION__
);
transfer_buffer
=
kmalloc
(
sizeof
(
*
connection_info
),
GFP_KERNEL
);
if
(
!
transfer_buffer
)
{
if
(
!
transfer_buffer
)
{
dev_err
(
dev
,
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
256
);
dev_err
(
dev
,
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
sizeof
(
*
connection_info
));
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s - Set config to 1"
,
__FUNCTION__
);
usb_set_configuration
(
serial
->
dev
,
1
);
/* send a get connection info request */
/* send a get connection info request */
response
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
VISOR_GET_CONNECTION_INFORMATION
,
retval
=
usb_control_msg
(
serial
->
dev
,
0xc2
,
0x0000
,
0x0000
,
transfer_buffer
,
0x12
,
300
);
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
if
(
response
<
0
)
{
VISOR_GET_CONNECTION_INFORMATION
,
dev_err
(
dev
,
"%s - error getting connection information
\n
"
,
__FUNCTION__
);
0xc2
,
0x0000
,
0x0000
,
transfer_buffer
,
}
else
{
sizeof
(
*
connection_info
),
300
);
struct
visor_connection_info
*
connection_info
=
(
struct
visor_connection_info
*
)
transfer_buffer
;
if
(
retval
<
0
)
{
char
*
string
;
dev_err
(
dev
,
"%s - error %d getting connection information
\n
"
,
__FUNCTION__
,
retval
);
le16_to_cpus
(
&
connection_info
->
num_ports
);
goto
exit
;
num_ports
=
connection_info
->
num_ports
;
dev_info
(
dev
,
"%s: Number of ports: %d
\n
"
,
serial
->
type
->
name
,
connection_info
->
num_ports
);
for
(
i
=
0
;
i
<
num_ports
;
++
i
)
{
switch
(
connection_info
->
connections
[
i
].
port_function_id
)
{
case
VISOR_FUNCTION_GENERIC
:
string
=
"Generic"
;
break
;
case
VISOR_FUNCTION_DEBUGGER
:
string
=
"Debugger"
;
break
;
case
VISOR_FUNCTION_HOTSYNC
:
string
=
"HotSync"
;
break
;
case
VISOR_FUNCTION_CONSOLE
:
string
=
"Console"
;
break
;
case
VISOR_FUNCTION_REMOTE_FILE_SYS
:
string
=
"Remote File System"
;
break
;
default:
string
=
"unknown"
;
break
;
}
dev_info
(
dev
,
"%s: port %d, is for %s use
\n
"
,
serial
->
type
->
name
,
connection_info
->
connections
[
i
].
port
,
string
);
/* save off our num_ports info so that we can use it in the calc_num_ports call */
usb_set_serial_data
(
serial
,
(
void
*
)(
long
)
num_ports
);
}
}
}
if
((
serial
->
dev
->
descriptor
.
idVendor
==
PALM_VENDOR_ID
)
||
connection_info
=
(
struct
visor_connection_info
*
)
transfer_buffer
;
((
serial
->
dev
->
descriptor
.
idVendor
==
SONY_VENDOR_ID
)
&&
(
serial
->
dev
->
descriptor
.
idProduct
!=
SONY_CLIE_4_1_ID
)))
{
le16_to_cpus
(
&
connection_info
->
num_ports
);
/* Palm OS 4.0 Hack */
num_ports
=
connection_info
->
num_ports
;
response
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
/* handle devices that report invalid stuff here */
PALM_GET_SOME_UNKNOWN_INFORMATION
,
if
(
num_ports
>
2
)
0xc2
,
0x0000
,
0x0000
,
transfer_buffer
,
num_ports
=
2
;
0x14
,
300
);
dev_info
(
dev
,
"%s: Number of ports: %d
\n
"
,
serial
->
type
->
name
,
if
(
response
<
0
)
{
connection_info
->
num_ports
);
dev_err
(
dev
,
"%s - error getting first unknown palm command
\n
"
,
__FUNCTION__
);
}
else
{
for
(
i
=
0
;
i
<
num_ports
;
++
i
)
{
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
0x14
,
transfer_buffer
);
switch
(
connection_info
->
connections
[
i
].
port_function_id
)
{
}
case
VISOR_FUNCTION_GENERIC
:
response
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
string
=
"Generic"
;
PALM_GET_SOME_UNKNOWN_INFORMATION
,
break
;
0xc2
,
0x0000
,
0x0000
,
transfer_buffer
,
case
VISOR_FUNCTION_DEBUGGER
:
0x14
,
300
);
string
=
"Debugger"
;
if
(
response
<
0
)
{
break
;
dev_err
(
dev
,
"%s - error getting second unknown palm command
\n
"
,
__FUNCTION__
);
case
VISOR_FUNCTION_HOTSYNC
:
}
else
{
string
=
"HotSync"
;
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
0x14
,
transfer_buffer
);
break
;
case
VISOR_FUNCTION_CONSOLE
:
string
=
"Console"
;
break
;
case
VISOR_FUNCTION_REMOTE_FILE_SYS
:
string
=
"Remote File System"
;
break
;
default:
string
=
"unknown"
;
break
;
}
}
dev_info
(
dev
,
"%s: port %d, is for %s use
\n
"
,
serial
->
type
->
name
,
connection_info
->
connections
[
i
].
port
,
string
);
}
}
/*
* save off our num_ports info so that we can use it in the
* calc_num_ports callback
*/
usb_set_serial_data
(
serial
,
(
void
*
)(
long
)
num_ports
);
/* ask for the number of bytes available, but ignore the response as it is broken */
/* ask for the number of bytes available, but ignore the response as it is broken */
response
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
VISOR_REQUEST_BYTES_AVAILABLE
,
retval
=
usb_control_msg
(
serial
->
dev
,
0xc2
,
0x0000
,
0x0005
,
transfer_buffer
,
0x02
,
300
);
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
if
(
response
<
0
)
{
VISOR_REQUEST_BYTES_AVAILABLE
,
dev_err
(
dev
,
"%s - error getting bytes available request
\n
"
,
__FUNCTION__
);
0xc2
,
0x0000
,
0x0005
,
transfer_buffer
,
}
0x02
,
300
);
if
(
retval
<
0
)
dev_err
(
dev
,
"%s - error %d getting bytes available request
\n
"
,
__FUNCTION__
,
retval
);
retval
=
0
;
exit:
kfree
(
transfer_buffer
);
kfree
(
transfer_buffer
);
/* continue on with initialization */
return
retval
;
}
static
int
palm_os_4_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
)
{
struct
device
*
dev
=
&
serial
->
dev
->
dev
;
struct
palm_ext_connection_info
*
connection_info
;
unsigned
char
*
transfer_buffer
;
int
retval
;
dbg
(
"%s"
,
__FUNCTION__
);
transfer_buffer
=
kmalloc
(
sizeof
(
*
connection_info
),
GFP_KERNEL
);
if
(
!
transfer_buffer
)
{
dev_err
(
dev
,
"%s - kmalloc(%d) failed.
\n
"
,
__FUNCTION__
,
sizeof
(
*
connection_info
));
return
-
ENOMEM
;
}
retval
=
usb_control_msg
(
serial
->
dev
,
usb_rcvctrlpipe
(
serial
->
dev
,
0
),
PALM_GET_EXT_CONNECTION_INFORMATION
,
0xc2
,
0x0000
,
0x0000
,
transfer_buffer
,
sizeof
(
*
connection_info
),
300
);
if
(
retval
<
0
)
dev_err
(
dev
,
"%s - error %d getting connection info
\n
"
,
__FUNCTION__
,
retval
);
else
usb_serial_debug_data
(
__FILE__
,
__FUNCTION__
,
0x14
,
transfer_buffer
);
kfree
(
transfer_buffer
);
return
0
;
return
0
;
}
}
static
int
visor_probe
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
)
{
int
retval
=
0
;
int
(
*
startup
)
(
struct
usb_serial
*
serial
,
const
struct
usb_device_id
*
id
);
dbg
(
"%s"
,
__FUNCTION__
);
dbg
(
"%s - Set config to 1"
,
__FUNCTION__
);
usb_set_configuration
(
serial
->
dev
,
1
);
if
(
id
->
driver_info
)
{
startup
=
(
void
*
)
id
->
driver_info
;
retval
=
startup
(
serial
,
id
);
}
return
retval
;
}
static
int
visor_calc_num_ports
(
struct
usb_serial
*
serial
)
static
int
visor_calc_num_ports
(
struct
usb_serial
*
serial
)
{
{
int
num_ports
=
(
int
)(
long
)(
usb_get_serial_data
(
serial
));
int
num_ports
=
(
int
)(
long
)(
usb_get_serial_data
(
serial
));
...
...
drivers/usb/serial/visor.h
View file @
fa4229ad
...
@@ -94,7 +94,36 @@ struct visor_connection_info {
...
@@ -94,7 +94,36 @@ struct visor_connection_info {
* PALM_GET_SOME_UNKNOWN_INFORMATION is sent by the host during enumeration to
* PALM_GET_SOME_UNKNOWN_INFORMATION is sent by the host during enumeration to
* get some information from the M series devices, that is currently unknown.
* get some information from the M series devices, that is currently unknown.
****************************************************************************/
****************************************************************************/
#define PALM_GET_SOME_UNKNOWN_INFORMATION 0x04
#define PALM_GET_EXT_CONNECTION_INFORMATION 0x04
/**
* struct palm_ext_connection_info - return data from a PALM_GET_EXT_CONNECTION_INFORMATION request
* @num_ports: maximum number of functions/connections in use
* @endpoint_numbers_different: will be 1 if in and out endpoints numbers are
* different, otherwise it is 0. If value is 1, then
* connections.end_point_info is non-zero. If value is 0, then
* connections.port contains the endpoint number, which is the same for in
* and out.
* @port_function_id: contains the creator id of the applicaton that opened
* this connection.
* @port: contains the in/out endpoint number. Is 0 if in and out endpoint
* numbers are different.
* @end_point_info: high nubbe is in endpoint and low nibble will indicate out
* endpoint. Is 0 if in and out endpoints are the same.
*
* The maximum number of connections currently supported is 2
*/
struct
palm_ext_connection_info
{
__u8
num_ports
;
__u8
endpoint_numbers_different
;
__u16
reserved1
;
struct
{
__u32
port_function_id
;
__u8
port
;
__u8
end_point_info
;
__u16
reserved
;
}
connections
[
2
];
};
#endif
#endif
drivers/usb/storage/debug.c
View file @
fa4229ad
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
void
usb_stor_show_command
(
Scsi_Cmnd
*
srb
)
void
usb_stor_show_command
(
Scsi_Cmnd
*
srb
)
{
{
char
*
what
=
NULL
;
char
*
what
=
NULL
;
int
i
;
switch
(
srb
->
cmnd
[
0
])
{
switch
(
srb
->
cmnd
[
0
])
{
case
TEST_UNIT_READY
:
what
=
"TEST_UNIT_READY"
;
break
;
case
TEST_UNIT_READY
:
what
=
"TEST_UNIT_READY"
;
break
;
...
@@ -143,29 +144,25 @@ void usb_stor_show_command(Scsi_Cmnd *srb)
...
@@ -143,29 +144,25 @@ void usb_stor_show_command(Scsi_Cmnd *srb)
default:
what
=
"(unknown command)"
;
break
;
default:
what
=
"(unknown command)"
;
break
;
}
}
US_DEBUGP
(
"Command %s (%d bytes)
\n
"
,
what
,
srb
->
cmd_len
);
US_DEBUGP
(
"Command %s (%d bytes)
\n
"
,
what
,
srb
->
cmd_len
);
US_DEBUGP
(
"%02x %02x %02x %02x "
US_DEBUGP
(
""
);
"%02x %02x %02x %02x "
for
(
i
=
0
;
i
<
srb
->
cmd_len
&&
i
<
16
;
i
++
)
"%02x %02x %02x %02x
\n
"
,
US_DEBUGPX
(
" %02x"
,
srb
->
cmnd
[
i
]);
srb
->
cmnd
[
0
],
srb
->
cmnd
[
1
],
srb
->
cmnd
[
2
],
srb
->
cmnd
[
3
],
US_DEBUGPX
(
"
\n
"
);
srb
->
cmnd
[
4
],
srb
->
cmnd
[
5
],
srb
->
cmnd
[
6
],
srb
->
cmnd
[
7
],
srb
->
cmnd
[
8
],
srb
->
cmnd
[
9
],
srb
->
cmnd
[
10
],
srb
->
cmnd
[
11
]);
}
}
void
usb_stor_print_Scsi_Cmnd
(
Scsi_Cmnd
*
cmd
)
void
usb_stor_print_Scsi_Cmnd
(
Scsi_Cmnd
*
cmd
)
{
{
int
i
=
0
,
bufferSize
=
cmd
->
request_bufflen
;
int
i
=
0
,
bufferSize
=
cmd
->
request_bufflen
;
u8
*
buffer
=
cmd
->
request_buffer
;
u8
*
buffer
=
cmd
->
request_buffer
;
struct
scatterlist
*
sg
=
(
struct
scatterlist
*
)
cmd
->
request_buffer
;
struct
scatterlist
*
sg
=
(
struct
scatterlist
*
)
cmd
->
request_buffer
;
US_DEBUGP
(
"Dumping information about %p.
\n
"
,
cmd
);
US_DEBUGP
(
"Dumping information about %p.
\n
"
,
cmd
);
US_DEBUGP
(
"cmd->cmnd[0] value is %d.
\n
"
,
cmd
->
cmnd
[
0
]
);
US_DEBUGP
(
"cmd->cmnd[0] value is %d.
\n
"
,
cmd
->
cmnd
[
0
]);
US_DEBUGP
(
"(MODE_SENSE is %d and MODE_SENSE_10 is %d)
\n
"
,
US_DEBUGP
(
"(MODE_SENSE is %d and MODE_SENSE_10 is %d)
\n
"
,
MODE_SENSE
,
MODE_SENSE_10
);
MODE_SENSE
,
MODE_SENSE_10
);
US_DEBUGP
(
"buffer is %p with length %d.
\n
"
,
buffer
,
bufferSize
);
US_DEBUGP
(
"buffer is %p with length %d.
\n
"
,
buffer
,
bufferSize
);
for
(
i
=
0
;
i
<
bufferSize
;
i
+=
16
)
for
(
i
=
0
;
i
<
bufferSize
;
i
+=
16
)
{
{
US_DEBUGP
(
"%02x %02x %02x %02x %02x %02x %02x %02x
\n
"
US_DEBUGP
(
"%02x %02x %02x %02x %02x %02x %02x %02x
\n
"
"%02x %02x %02x %02x %02x %02x %02x %02x
\n
"
,
"%02x %02x %02x %02x %02x %02x %02x %02x
\n
"
,
buffer
[
i
],
buffer
[
i
],
...
@@ -187,8 +184,7 @@ void usb_stor_print_Scsi_Cmnd( Scsi_Cmnd* cmd )
...
@@ -187,8 +184,7 @@ void usb_stor_print_Scsi_Cmnd( Scsi_Cmnd* cmd )
}
}
US_DEBUGP
(
"Buffer has %d scatterlists.
\n
"
,
cmd
->
use_sg
);
US_DEBUGP
(
"Buffer has %d scatterlists.
\n
"
,
cmd
->
use_sg
);
for
(
i
=
0
;
i
<
cmd
->
use_sg
;
i
++
)
for
(
i
=
0
;
i
<
cmd
->
use_sg
;
i
++
)
{
{
char
*
adr
=
sg_address
(
sg
[
i
]);
char
*
adr
=
sg_address
(
sg
[
i
]);
US_DEBUGP
(
"Length of scatterlist %d is %d.
\n
"
,
i
,
sg
[
i
].
length
);
US_DEBUGP
(
"Length of scatterlist %d is %d.
\n
"
,
i
,
sg
[
i
].
length
);
...
...
drivers/usb/usb-skeleton.c
View file @
fa4229ad
...
@@ -86,7 +86,7 @@ MODULE_DEVICE_TABLE (usb, skel_table);
...
@@ -86,7 +86,7 @@ MODULE_DEVICE_TABLE (usb, skel_table);
#define USB_SKEL_MINOR_BASE 0
#define USB_SKEL_MINOR_BASE 0
#else
#else
/* Get a minor range for your devices from the usb maintainer */
/* Get a minor range for your devices from the usb maintainer */
#define USB_SKEL_MINOR_BASE
200
#define USB_SKEL_MINOR_BASE
192
#endif
#endif
/* Structure to hold all of our device specific stuff */
/* Structure to hold all of our device specific stuff */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment