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
aaf2a6b6
Commit
aaf2a6b6
authored
Feb 18, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
cd566b34
f0cefc01
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
79 deletions
+51
-79
drivers/usb/hub.c
drivers/usb/hub.c
+34
-26
drivers/usb/inode.c
drivers/usb/inode.c
+0
-46
drivers/usb/serial/visor.c
drivers/usb/serial/visor.c
+7
-2
drivers/usb/serial/visor.h
drivers/usb/serial/visor.h
+2
-1
drivers/usb/usb-skeleton.c
drivers/usb/usb-skeleton.c
+5
-1
drivers/usb/usb.c
drivers/usb/usb.c
+3
-3
No files found.
drivers/usb/hub.c
View file @
aaf2a6b6
...
...
@@ -524,6 +524,29 @@ static void usb_hub_disconnect(struct usb_device *dev)
err
(
"cannot disconnect hub %s"
,
dev
->
devpath
);
}
static
int
usb_hub_port_status
(
struct
usb_device
*
hub
,
int
port
,
u16
*
status
,
u16
*
change
)
{
struct
usb_port_status
*
portsts
;
int
ret
=
-
ENOMEM
;
portsts
=
kmalloc
(
sizeof
(
*
portsts
),
GFP_KERNEL
);
if
(
portsts
)
{
ret
=
usb_get_port_status
(
hub
,
port
+
1
,
portsts
);
if
(
ret
<
0
)
err
(
"%s(%s) failed (err = %d)"
,
__FUNCTION__
,
hub
->
devpath
,
ret
);
else
{
*
status
=
le16_to_cpu
(
portsts
->
wPortStatus
);
*
change
=
le16_to_cpu
(
portsts
->
wPortChange
);
dbg
(
"port %d, portstatus %x, change %x, %s"
,
port
+
1
,
*
status
,
*
change
,
portspeed
(
*
status
));
ret
=
0
;
}
kfree
(
portsts
);
}
return
ret
;
}
#define HUB_RESET_TRIES 5
#define HUB_PROBE_TRIES 2
#define HUB_SHORT_RESET_TIME 10
...
...
@@ -535,8 +558,8 @@ static int usb_hub_port_wait_reset(struct usb_device *hub, int port,
struct
usb_device
*
dev
,
unsigned
int
delay
)
{
int
delay_time
,
ret
;
struct
usb_port_status
portst
s
;
u
nsigned
short
portchange
,
portstatus
;
u16
portstatu
s
;
u
16
portchange
;
for
(
delay_time
=
0
;
delay_time
<
HUB_RESET_TIMEOUT
;
...
...
@@ -545,18 +568,11 @@ static int usb_hub_port_wait_reset(struct usb_device *hub, int port,
wait_ms
(
delay
);
/* read and decode port status */
ret
=
usb_
get_port_status
(
hub
,
port
+
1
,
&
portsts
);
ret
=
usb_
hub_port_status
(
hub
,
port
,
&
portstatus
,
&
portchange
);
if
(
ret
<
0
)
{
err
(
"get_port_status(%d) failed (err = %d)"
,
port
+
1
,
ret
);
return
-
1
;
}
portstatus
=
le16_to_cpu
(
portsts
.
wPortStatus
);
portchange
=
le16_to_cpu
(
portsts
.
wPortChange
);
dbg
(
"port %d, portstatus %x, change %x, %s"
,
port
+
1
,
portstatus
,
portchange
,
portspeed
(
portstatus
));
/* Device went away? */
if
(
!
(
portstatus
&
USB_PORT_STAT_CONNECTION
))
return
1
;
...
...
@@ -629,16 +645,13 @@ void usb_hub_port_disable(struct usb_device *hub, int port)
}
static
void
usb_hub_port_connect_change
(
struct
usb_hub
*
hubstate
,
int
port
,
struct
usb_port_status
*
portsts
)
u16
portstatus
,
u16
portchange
)
{
struct
usb_device
*
hub
=
hubstate
->
dev
;
struct
usb_device
*
dev
;
unsigned
short
portstatus
,
portchange
;
unsigned
int
delay
=
HUB_SHORT_RESET_TIME
;
int
i
;
portstatus
=
le16_to_cpu
(
portsts
->
wPortStatus
);
portchange
=
le16_to_cpu
(
portsts
->
wPortChange
);
dbg
(
"hub %s port %d, portstatus %x, change %x, %s"
,
hub
->
devpath
,
port
+
1
,
portstatus
,
portchange
,
portspeed
(
portstatus
));
...
...
@@ -759,7 +772,10 @@ static void usb_hub_events(void)
struct
usb_device
*
dev
;
struct
usb_hub
*
hub
;
struct
usb_hub_status
hubsts
;
unsigned
short
hubstatus
,
hubchange
;
u16
hubstatus
;
u16
hubchange
;
u16
portstatus
;
u16
portchange
;
int
i
,
ret
;
/*
...
...
@@ -803,23 +819,15 @@ static void usb_hub_events(void)
}
for
(
i
=
0
;
i
<
hub
->
descriptor
->
bNbrPorts
;
i
++
)
{
struct
usb_port_status
portsts
;
unsigned
short
portstatus
,
portchange
;
ret
=
usb_get_port_status
(
dev
,
i
+
1
,
&
portsts
);
ret
=
usb_hub_port_status
(
dev
,
i
,
&
portstatus
,
&
portchange
);
if
(
ret
<
0
)
{
err
(
"hub %s get_port_status failed (err = %d)"
,
dev
->
devpath
,
ret
);
continue
;
}
portstatus
=
le16_to_cpu
(
portsts
.
wPortStatus
);
portchange
=
le16_to_cpu
(
portsts
.
wPortChange
);
if
(
portchange
&
USB_PORT_STAT_C_CONNECTION
)
{
dbg
(
"hub %s port %d connection change"
,
dev
->
devpath
,
i
+
1
);
usb_hub_port_connect_change
(
hub
,
i
,
&
portsts
);
usb_hub_port_connect_change
(
hub
,
i
,
portstatus
,
portchange
);
}
else
if
(
portchange
&
USB_PORT_STAT_C_ENABLE
)
{
dbg
(
"hub %s port %d enable change, status %x"
,
dev
->
devpath
,
i
+
1
,
portstatus
);
...
...
@@ -840,7 +848,7 @@ static void usb_hub_events(void)
"re-enabling..."
,
dev
->
devpath
,
i
+
1
);
usb_hub_port_connect_change
(
hub
,
i
,
&
portsts
);
i
,
portstatus
,
portchange
);
}
}
...
...
drivers/usb/inode.c
View file @
aaf2a6b6
...
...
@@ -40,7 +40,6 @@
#include <asm/byteorder.h>
static
struct
super_operations
usbfs_ops
;
static
struct
address_space_operations
usbfs_aops
;
static
struct
file_operations
usbfs_dir_operations
;
static
struct
file_operations
default_file_operations
;
static
struct
inode_operations
usbfs_dir_inode_operations
;
...
...
@@ -168,7 +167,6 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, int dev)
inode
->
i_blksize
=
PAGE_CACHE_SIZE
;
inode
->
i_blocks
=
0
;
inode
->
i_rdev
=
NODEV
;
inode
->
i_mapping
->
a_ops
=
&
usbfs_aops
;
inode
->
i_atime
=
inode
->
i_mtime
=
inode
->
i_ctime
=
CURRENT_TIME
;
switch
(
mode
&
S_IFMT
)
{
default:
...
...
@@ -186,7 +184,6 @@ static struct inode *usbfs_get_inode (struct super_block *sb, int mode, int dev)
return
inode
;
}
/* SMP-safe */
static
int
usbfs_mknod
(
struct
inode
*
dir
,
struct
dentry
*
dentry
,
int
mode
,
int
dev
)
{
...
...
@@ -211,18 +208,6 @@ static int usbfs_create (struct inode *dir, struct dentry *dentry, int mode)
return
usbfs_mknod
(
dir
,
dentry
,
mode
|
S_IFREG
,
0
);
}
static
int
usbfs_link
(
struct
dentry
*
old_dentry
,
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
struct
inode
*
inode
=
old_dentry
->
d_inode
;
inode
->
i_nlink
++
;
atomic_inc
(
&
inode
->
i_count
);
dget
(
dentry
);
d_instantiate
(
dentry
,
inode
);
return
0
;
}
static
inline
int
usbfs_positive
(
struct
dentry
*
dentry
)
{
return
dentry
->
d_inode
&&
!
d_unhashed
(
dentry
);
...
...
@@ -260,22 +245,6 @@ static int usbfs_unlink (struct inode *dir, struct dentry *dentry)
return
error
;
}
static
int
usbfs_rename
(
struct
inode
*
old_dir
,
struct
dentry
*
old_dentry
,
struct
inode
*
new_dir
,
struct
dentry
*
new_dentry
)
{
int
error
=
-
ENOTEMPTY
;
if
(
usbfs_empty
(
new_dentry
))
{
struct
inode
*
inode
=
new_dentry
->
d_inode
;
if
(
inode
)
{
inode
->
i_nlink
--
;
dput
(
new_dentry
);
}
error
=
0
;
}
return
error
;
}
#define usbfs_rmdir usbfs_unlink
/* default file operations */
...
...
@@ -324,19 +293,9 @@ static int default_open (struct inode *inode, struct file *filp)
return
0
;
}
static
int
default_sync_file
(
struct
file
*
file
,
struct
dentry
*
dentry
,
int
datasync
)
{
return
0
;
}
static
struct
address_space_operations
usbfs_aops
=
{
};
static
struct
file_operations
usbfs_dir_operations
=
{
read:
generic_read_dir
,
readdir:
dcache_readdir
,
fsync:
default_sync_file
,
};
static
struct
file_operations
default_file_operations
=
{
...
...
@@ -344,19 +303,14 @@ static struct file_operations default_file_operations = {
write:
default_write_file
,
open:
default_open
,
llseek:
default_file_lseek
,
fsync:
default_sync_file
,
mmap:
generic_file_mmap
,
};
static
struct
inode_operations
usbfs_dir_inode_operations
=
{
create:
usbfs_create
,
lookup:
usbfs_lookup
,
link:
usbfs_link
,
unlink:
usbfs_unlink
,
mkdir:
usbfs_mkdir
,
rmdir:
usbfs_rmdir
,
mknod:
usbfs_mknod
,
rename:
usbfs_rename
,
};
static
struct
super_operations
usbfs_ops
=
{
...
...
drivers/usb/serial/visor.c
View file @
aaf2a6b6
...
...
@@ -2,7 +2,7 @@
* USB HandSpring Visor, Palm m50x, and Sony Clie driver
* (supports all of the Palm OS USB devices)
*
* Copyright (C) 1999 - 200
1
* Copyright (C) 1999 - 200
2
* Greg Kroah-Hartman (greg@kroah.com)
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -12,6 +12,9 @@
*
* See Documentation/usb/usb-serial.txt for more information on using this driver
*
* (02/14/2002) gkh
* Added support for the Clie S-360 device.
*
* (12/18/2001) gkh
* Added better Clie support for 3.5 devices. Thanks to Geoffrey Levand
* for the patch.
...
...
@@ -131,7 +134,7 @@
/*
* Version Information
*/
#define DRIVER_VERSION "v1.
8
"
#define DRIVER_VERSION "v1.
9
"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>"
#define DRIVER_DESC "USB HandSpring Visor, Palm m50x, Sony Clié driver"
...
...
@@ -158,6 +161,7 @@ static __devinitdata struct usb_device_id combined_id_table [] = {
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M125_ID
)
},
{
USB_DEVICE
(
HANDSPRING_VENDOR_ID
,
HANDSPRING_VISOR_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_0_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_S360_ID
)
},
{
}
/* Terminating entry */
};
...
...
@@ -173,6 +177,7 @@ static __devinitdata struct usb_device_id id_table [] = {
{
USB_DEVICE
(
PALM_VENDOR_ID
,
PALM_M125_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_3_5_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_4_0_ID
)
},
{
USB_DEVICE
(
SONY_VENDOR_ID
,
SONY_CLIE_S360_ID
)
},
{
}
/* Terminating entry */
};
...
...
drivers/usb/serial/visor.h
View file @
aaf2a6b6
/*
* USB HandSpring Visor driver
*
* Copyright (C) 1999 - 200
1
* Copyright (C) 1999 - 200
2
* Greg Kroah-Hartman (greg@kroah.com)
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -28,6 +28,7 @@
#define SONY_VENDOR_ID 0x054C
#define SONY_CLIE_3_5_ID 0x0038
#define SONY_CLIE_4_0_ID 0x0066
#define SONY_CLIE_S360_ID 0x0095
/****************************************************************************
* Handspring Visor Vendor specific request codes (bRequest values)
...
...
drivers/usb/usb-skeleton.c
View file @
aaf2a6b6
/*
* USB Skeleton driver - 0.
6
* USB Skeleton driver - 0.
7
*
* Copyright (c) 2001 Greg Kroah-Hartman (greg@kroah.com)
*
...
...
@@ -22,6 +22,9 @@
*
* History:
*
* 2002_02_12 - 0.7 - zero out dev in probe function for devices that do
* not have both a bulk in and bulk out endpoint.
* Thanks to Holger Waechtler for the fix.
* 2001_11_05 - 0.6 - fix minor locking problem in skel_disconnect.
* Thanks to Pete Zaitcev for the fix.
* 2001_09_04 - 0.5 - fix devfs bug in skel_disconnect. Thanks to wim delvaux
...
...
@@ -542,6 +545,7 @@ static void * skel_probe(struct usb_device *udev, unsigned int ifnum, const stru
err
(
"Out of memory"
);
goto
exit
;
}
memset
(
dev
,
0x00
,
sizeof
(
*
dev
));
minor_table
[
minor
]
=
dev
;
interface
=
&
udev
->
actconfig
->
interface
[
ifnum
];
...
...
drivers/usb/usb.c
View file @
aaf2a6b6
...
...
@@ -1979,11 +1979,11 @@ void usb_disconnect(struct usb_device **pdev)
if
(
driver
->
owner
)
__MOD_DEC_USE_COUNT
(
driver
->
owner
);
/* if driver->disconnect didn't release the interface */
if
(
interface
->
driver
)
{
put_device
(
&
interface
->
dev
);
if
(
interface
->
driver
)
usb_driver_release_interface
(
driver
,
interface
);
}
}
/* remove our device node for this interface */
put_device
(
&
interface
->
dev
);
}
}
...
...
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