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
nexedi
linux
Commits
0137957a
Commit
0137957a
authored
Nov 18, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/gregkh/linux/usb-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
f655aadc
b594df6e
Changes
14
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
499 additions
and
191 deletions
+499
-191
drivers/usb/input/Kconfig
drivers/usb/input/Kconfig
+3
-0
drivers/usb/net/pegasus.c
drivers/usb/net/pegasus.c
+4
-4
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.c
+1
-0
drivers/usb/serial/ipaq.c
drivers/usb/serial/ipaq.c
+442
-41
drivers/usb/serial/ipaq.h
drivers/usb/serial/ipaq.h
+0
-75
drivers/usb/serial/pl2303.c
drivers/usb/serial/pl2303.c
+2
-0
drivers/usb/serial/pl2303.h
drivers/usb/serial/pl2303.h
+2
-0
drivers/usb/serial/visor.c
drivers/usb/serial/visor.c
+2
-1
drivers/usb/storage/isd200.c
drivers/usb/storage/isd200.c
+2
-2
drivers/usb/storage/scsiglue.c
drivers/usb/storage/scsiglue.c
+12
-41
drivers/usb/storage/transport.c
drivers/usb/storage/transport.c
+2
-2
drivers/usb/storage/unusual_devs.h
drivers/usb/storage/unusual_devs.h
+13
-5
drivers/usb/storage/usb.c
drivers/usb/storage/usb.c
+13
-13
drivers/usb/storage/usb.h
drivers/usb/storage/usb.h
+1
-7
No files found.
drivers/usb/input/Kconfig
View file @
0137957a
...
...
@@ -200,6 +200,9 @@ config USB_EGALAX
The driver has been tested on a Xenarc 700TSV monitor
with eGalax touchscreen.
Have a look at http://linux.chapter7.ch/touchkit/ for
a usage description and the required user-space stuff.
To compile this driver as a module, choose M here: the
module will be called touchkitusb.
...
...
drivers/usb/net/pegasus.c
View file @
0137957a
...
...
@@ -322,7 +322,7 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd)
*
(
data
+
1
)
=
cpu_to_le16p
(
&
regd
);
set_register
(
pegasus
,
PhyCtrl
,
0
);
set_registers
(
pegasus
,
PhyAddr
,
4
,
data
);
set_registers
(
pegasus
,
PhyAddr
,
sizeof
(
data
)
,
data
);
set_register
(
pegasus
,
PhyCtrl
,
(
indx
|
PHY_WRITE
));
for
(
i
=
0
;
i
<
REG_TIMEOUT
;
i
++
)
{
get_registers
(
pegasus
,
PhyCtrl
,
1
,
data
);
...
...
@@ -388,8 +388,8 @@ static inline void disable_eprom_write(pegasus_t * pegasus)
static
int
write_eprom_word
(
pegasus_t
*
pegasus
,
__u8
index
,
__u16
data
)
{
int
i
,
tmp
;
__u8
d
[
4
]
=
{
0x3f
,
0
,
0
,
EPROM_WRITE
};
int
i
;
__u8
tmp
,
d
[
4
]
=
{
0x3f
,
0
,
0
,
EPROM_WRITE
};
set_registers
(
pegasus
,
EpromOffset
,
4
,
d
);
enable_eprom_write
(
pegasus
);
...
...
@@ -1114,7 +1114,7 @@ static __u8 mii_phy_probe(pegasus_t * pegasus)
static
inline
void
setup_pegasus_II
(
pegasus_t
*
pegasus
)
{
u16
data
=
0xa5
;
__u8
data
=
0xa5
;
set_register
(
pegasus
,
Reg1d
,
0
);
set_register
(
pegasus
,
Reg7b
,
1
);
...
...
drivers/usb/serial/ftdi_sio.c
View file @
0137957a
...
...
@@ -536,6 +536,7 @@ static struct usb_device_id id_table_combined [] = {
{
USB_DEVICE_VER
(
FTDI_VID
,
FTDI_MTXORB_5_PID
,
0x400
,
0xffff
)
},
{
USB_DEVICE_VER
(
FTDI_VID
,
FTDI_MTXORB_6_PID
,
0x400
,
0xffff
)
},
{
USB_DEVICE_VER
(
FTDI_VID
,
FTDI_PERLE_ULTRAPORT_PID
,
0x400
,
0xffff
)
},
{
USB_DEVICE
(
FTDI_VID
,
FTDI_PIEGROUP_PID
)
},
{
USB_DEVICE
(
SEALEVEL_VID
,
SEALEVEL_2101_PID
)
},
{
USB_DEVICE
(
SEALEVEL_VID
,
SEALEVEL_2102_PID
)
},
{
USB_DEVICE
(
SEALEVEL_VID
,
SEALEVEL_2103_PID
)
},
...
...
drivers/usb/serial/ipaq.c
View file @
0137957a
This diff is collapsed.
Click to expand it.
drivers/usb/serial/ipaq.h
View file @
0137957a
...
...
@@ -14,81 +14,6 @@
#ifndef __LINUX_USB_SERIAL_IPAQ_H
#define __LINUX_USB_SERIAL_IPAQ_H
#define ASKEY_VENDOR_ID 0x1690
#define ASKEY_PRODUCT_ID 0x0601
#define BCOM_VENDOR_ID 0x0960
#define BCOM_0065_ID 0x0065
#define BCOM_0066_ID 0x0066
#define BCOM_0067_ID 0x0067
#define CASIO_VENDOR_ID 0x07cf
#define CASIO_2001_ID 0x2001
#define CASIO_EM500_ID 0x2002
#define COMPAQ_VENDOR_ID 0x049f
#define COMPAQ_IPAQ_ID 0x0003
#define COMPAQ_0032_ID 0x0032
#define DELL_VENDOR_ID 0x413c
#define DELL_AXIM_ID 0x4001
#define FSC_VENDOR_ID 0x0bf8
#define FSC_LOOX_ID 0x1001
#define HP_VENDOR_ID 0x03f0
#define HP_JORNADA_548_ID 0x1016
#define HP_JORNADA_568_ID 0x1116
#define HP_2016_ID 0x2016
#define HP_2116_ID 0x2116
#define HP_2216_ID 0x2216
#define HP_3016_ID 0x3016
#define HP_3116_ID 0x3116
#define HP_3216_ID 0x3216
#define HP_4016_ID 0x4016
#define HP_4116_ID 0x4116
#define HP_4216_ID 0x4216
#define HP_5016_ID 0x5016
#define HP_5116_ID 0x5116
#define HP_5216_ID 0x5216
#define LINKUP_VENDOR_ID 0x094b
#define LINKUP_PRODUCT_ID 0x0001
#define MICROSOFT_VENDOR_ID 0x045e
#define MICROSOFT_00CE_ID 0x00ce
#define PORTATEC_VENDOR_ID 0x0961
#define PORTATEC_PRODUCT_ID 0x0010
#define ROVER_VENDOR_ID 0x047b
#define ROVER_P5_ID 0x3000
#define SAGEM_VENDOR_ID 0x5e04
#define SAGEM_WIRELESS_ID 0xce00
#define SOCKET_VENDOR_ID 0x0104
#define SOCKET_PRODUCT_ID 0x00be
#define TOSHIBA_VENDOR_ID 0x0930
#define TOSHIBA_PRODUCT_ID 0x0700
#define TOSHIBA_E310_ID 0x0705
#define TOSHIBA_E740_ID 0x0706
#define TOSHIBA_E335_ID 0x0707
#define HTC_VENDOR_ID 0x0bb4
#define HTC_PRODUCT_ID 0x00ce
#define HTC_HIMALAYA_ID 0x0a02
#define NEC_VENDOR_ID 0x0409
#define NEC_PRODUCT_ID 0x00d5
#define ASUS_VENDOR_ID 0x0b05
#define ASUS_A600_PRODUCT_ID 0x4201
#define ASUS_VENDOR_ID 0x0b05
#define ASUS_A620_PRODUCT_ID 0x4202
/*
* Since we can't queue our bulk write urbs (don't know why - it just
* doesn't work), we can send down only one write urb at a time. The simplistic
...
...
drivers/usb/serial/pl2303.c
View file @
0137957a
...
...
@@ -77,11 +77,13 @@ struct pl2303_buf {
static
struct
usb_device_id
id_table
[]
=
{
{
USB_DEVICE
(
PL2303_VENDOR_ID
,
PL2303_PRODUCT_ID
)
},
{
USB_DEVICE
(
PL2303_VENDOR_ID
,
PL2303_PRODUCT_ID_RSAQ2
)
},
{
USB_DEVICE
(
PL2303_VENDOR_ID
,
PL2303_PRODUCT_ID_RSAQ3
)
},
{
USB_DEVICE
(
PL2303_VENDOR_ID
,
PL2303_PRODUCT_ID_PHAROS
)
},
{
USB_DEVICE
(
IODATA_VENDOR_ID
,
IODATA_PRODUCT_ID
)
},
{
USB_DEVICE
(
ATEN_VENDOR_ID
,
ATEN_PRODUCT_ID
)
},
{
USB_DEVICE
(
ATEN_VENDOR_ID2
,
ATEN_PRODUCT_ID
)
},
{
USB_DEVICE
(
ELCOM_VENDOR_ID
,
ELCOM_PRODUCT_ID
)
},
{
USB_DEVICE
(
ELCOM_VENDOR_ID
,
ELCOM_PRODUCT_ID_UCSGT
)
},
{
USB_DEVICE
(
ITEGNO_VENDOR_ID
,
ITEGNO_PRODUCT_ID
)
},
{
USB_DEVICE
(
MA620_VENDOR_ID
,
MA620_PRODUCT_ID
)
},
{
USB_DEVICE
(
RATOC_VENDOR_ID
,
RATOC_PRODUCT_ID
)
},
...
...
drivers/usb/serial/pl2303.h
View file @
0137957a
...
...
@@ -11,6 +11,7 @@
#define PL2303_PRODUCT_ID 0x2303
#define PL2303_PRODUCT_ID_RSAQ2 0x04bb
#define PL2303_PRODUCT_ID_PHAROS 0xaaa0
#define PL2303_PRODUCT_ID_RSAQ3 0xaaa2
#define ATEN_VENDOR_ID 0x0557
#define ATEN_VENDOR_ID2 0x0547
...
...
@@ -21,6 +22,7 @@
#define ELCOM_VENDOR_ID 0x056e
#define ELCOM_PRODUCT_ID 0x5003
#define ELCOM_PRODUCT_ID_UCSGT 0x5004
#define ITEGNO_VENDOR_ID 0x0eba
#define ITEGNO_PRODUCT_ID 0x1080
...
...
drivers/usb/serial/visor.c
View file @
0137957a
...
...
@@ -930,7 +930,7 @@ static int treo_attach (struct usb_serial *serial)
if
(
!
((
serial
->
dev
->
descriptor
.
idVendor
==
HANDSPRING_VENDOR_ID
)
||
(
serial
->
dev
->
descriptor
.
idVendor
==
KYOCERA_VENDOR_ID
))
||
(
serial
->
num_interrupt_in
==
0
))
return
0
;
goto
generic_startup
;
dbg
(
"%s"
,
__FUNCTION__
);
...
...
@@ -957,6 +957,7 @@ static int treo_attach (struct usb_serial *serial)
COPY_PORT
(
serial
->
port
[
1
],
swap_port
);
kfree
(
swap_port
);
generic_startup:
return
generic_startup
(
serial
);
}
...
...
drivers/usb/storage/isd200.c
View file @
0137957a
...
...
@@ -555,7 +555,7 @@ static void isd200_invoke_transport( struct us_data *us,
/* if the command gets aborted by the higher layers, we need to
* short-circuit all other processing
*/
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
{
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
{
US_DEBUGP
(
"-- command was aborted
\n
"
);
goto
Handle_Abort
;
}
...
...
@@ -602,7 +602,7 @@ static void isd200_invoke_transport( struct us_data *us,
if
(
need_auto_sense
)
{
result
=
isd200_read_regs
(
us
);
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
{
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
{
US_DEBUGP
(
"-- auto-sense aborted
\n
"
);
goto
Handle_Abort
;
}
...
...
drivers/usb/storage/scsiglue.c
View file @
0137957a
...
...
@@ -73,14 +73,11 @@ static const char* host_info(struct Scsi_Host *host)
static
int
slave_alloc
(
struct
scsi_device
*
sdev
)
{
/*
* Set default bflags. These can be overridden for individual
* models and vendors via the scsi devinfo mechanism. The only
* flag we need is to force 36-byte INQUIRYs; we don't use any
* of the extra data and many devices choke if asked for more or
* Set the INQUIRY transfer length to 36. We don't use any of
* the extra data and many devices choke if asked for more or
* less than 36 bytes.
*/
sdev
->
sdev_bflags
=
BLIST_INQUIRY_36
;
sdev
->
inquiry_len
=
36
;
return
0
;
}
...
...
@@ -176,10 +173,9 @@ static int queuecommand(struct scsi_cmnd *srb,
srb
->
host_scribble
=
(
unsigned
char
*
)
us
;
/* check for state-transition errors */
if
(
us
->
sm_state
!=
US_STATE_IDLE
||
us
->
srb
!=
NULL
)
{
printk
(
KERN_ERR
USB_STORAGE
"Error in %s: "
"state = %d, us->srb = %p
\n
"
,
__FUNCTION__
,
us
->
sm_state
,
us
->
srb
);
if
(
us
->
srb
!=
NULL
)
{
printk
(
KERN_ERR
USB_STORAGE
"Error in %s: us->srb = %p
\n
"
,
__FUNCTION__
,
us
->
srb
);
return
SCSI_MLQUEUE_HOST_BUSY
;
}
...
...
@@ -203,7 +199,7 @@ static int queuecommand(struct scsi_cmnd *srb,
* Error handling functions
***********************************************************************/
/* Command abort */
/* Command
timeout and
abort */
/* This is always called with scsi_lock(srb->host) held */
static
int
command_abort
(
struct
scsi_cmnd
*
srb
)
{
...
...
@@ -218,22 +214,12 @@ static int command_abort(struct scsi_cmnd *srb )
return
FAILED
;
}
/* Normally the current state is RUNNING. If the control thread
* hasn't even started processing this command, the state will be
* IDLE. Anything else is a bug. */
if
(
us
->
sm_state
!=
US_STATE_RUNNING
&&
us
->
sm_state
!=
US_STATE_IDLE
)
{
printk
(
KERN_ERR
USB_STORAGE
"Error in %s: "
"invalid state %d
\n
"
,
__FUNCTION__
,
us
->
sm_state
);
return
FAILED
;
}
/* Set state to ABORTING and set the ABORTING bit, but only if
/* Set the TIMED_OUT bit. Also set the ABORTING bit, but only if
* a device reset isn't already in progress (to avoid interfering
* with the reset). To prevent races with auto-reset, we must
* stop any ongoing USB transfers while still holding the host
* lock. */
us
->
sm_state
=
US_STATE_ABORTING
;
set_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
;
if
(
!
test_bit
(
US_FLIDX_RESETTING
,
&
us
->
flags
))
{
set_bit
(
US_FLIDX_ABORTING
,
&
us
->
flags
);
usb_stor_stop_transport
(
us
);
...
...
@@ -246,6 +232,7 @@ static int command_abort(struct scsi_cmnd *srb )
/* Reacquire the lock and allow USB transfers to resume */
scsi_lock
(
host
);
clear_bit
(
US_FLIDX_ABORTING
,
&
us
->
flags
);
clear_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
);
return
SUCCESS
;
}
...
...
@@ -258,14 +245,7 @@ static int device_reset(struct scsi_cmnd *srb)
int
result
;
US_DEBUGP
(
"%s called
\n
"
,
__FUNCTION__
);
if
(
us
->
sm_state
!=
US_STATE_IDLE
)
{
printk
(
KERN_ERR
USB_STORAGE
"Error in %s: "
"invalid state %d
\n
"
,
__FUNCTION__
,
us
->
sm_state
);
return
FAILED
;
}
/* set the state and release the lock */
us
->
sm_state
=
US_STATE_RESETTING
;
scsi_unlock
(
srb
->
device
->
host
);
/* lock the device pointers and do the reset */
...
...
@@ -277,9 +257,8 @@ static int device_reset(struct scsi_cmnd *srb)
result
=
us
->
transport_reset
(
us
);
up
(
&
(
us
->
dev_semaphore
));
/* lock
access to the state and clear it
*/
/* lock
the host for the return
*/
scsi_lock
(
srb
->
device
->
host
);
us
->
sm_state
=
US_STATE_IDLE
;
return
result
;
}
...
...
@@ -293,14 +272,7 @@ static int bus_reset(struct scsi_cmnd *srb)
int
result
,
rc
;
US_DEBUGP
(
"%s called
\n
"
,
__FUNCTION__
);
if
(
us
->
sm_state
!=
US_STATE_IDLE
)
{
printk
(
KERN_ERR
USB_STORAGE
"Error in %s: "
"invalid state %d
\n
"
,
__FUNCTION__
,
us
->
sm_state
);
return
FAILED
;
}
/* set the state and release the lock */
us
->
sm_state
=
US_STATE_RESETTING
;
scsi_unlock
(
srb
->
device
->
host
);
/* The USB subsystem doesn't handle synchronisation between
...
...
@@ -328,9 +300,8 @@ static int bus_reset(struct scsi_cmnd *srb)
}
up
(
&
(
us
->
dev_semaphore
));
/* lock
access to the state and clear it
*/
/* lock
the host for the return
*/
scsi_lock
(
srb
->
device
->
host
);
us
->
sm_state
=
US_STATE_IDLE
;
return
result
<
0
?
FAILED
:
SUCCESS
;
}
...
...
drivers/usb/storage/transport.c
View file @
0137957a
...
...
@@ -537,7 +537,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
/* if the command gets aborted by the higher layers, we need to
* short-circuit all other processing
*/
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
{
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
{
US_DEBUGP
(
"-- command was aborted
\n
"
);
goto
Handle_Abort
;
}
...
...
@@ -665,7 +665,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
srb
->
cmd_len
=
old_cmd_len
;
memcpy
(
srb
->
cmnd
,
old_cmnd
,
MAX_COMMAND_SIZE
);
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
{
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
{
US_DEBUGP
(
"-- auto-sense aborted
\n
"
);
goto
Handle_Abort
;
}
...
...
drivers/usb/storage/unusual_devs.h
View file @
0137957a
...
...
@@ -266,16 +266,16 @@ UNUSUAL_DEV( 0x0525, 0xa140, 0x0100, 0x0100,
US_SC_8070
,
US_PR_BULK
,
NULL
,
US_FL_FIX_INQUIRY
),
/* Reported by Iacopo Spalletti <avvisi@spalletti.it> */
UNUSUAL_DEV
(
0x052b
,
0x1807
,
0x0100
,
0x0100
,
/* Yakumo Mega Image 37
* Submitted by Stephan Fuhrmann <atomenergie@t-online.de> */
UNUSUAL_DEV
(
0x052b
,
0x1801
,
0x0100
,
0x0100
,
"Tekom Technologies, Inc"
,
"300_CAMERA"
,
US_SC_DEVICE
,
US_PR_DEVICE
,
NULL
,
US_FL_IGNORE_RESIDUE
),
/* Yakumo Mega Image 37
* Submitted by Stephan Fuhrmann <atomenergie@t-online.de> */
UNUSUAL_DEV
(
0x052b
,
0x1801
,
0x0100
,
0x0100
,
/* Reported by Iacopo Spalletti <avvisi@spalletti.it> */
UNUSUAL_DEV
(
0x052b
,
0x1807
,
0x0100
,
0x0100
,
"Tekom Technologies, Inc"
,
"300_CAMERA"
,
US_SC_DEVICE
,
US_PR_DEVICE
,
NULL
,
...
...
@@ -289,6 +289,14 @@ UNUSUAL_DEV( 0x052b, 0x1905, 0x0100, 0x0100,
US_SC_DEVICE
,
US_PR_DEVICE
,
NULL
,
US_FL_IGNORE_RESIDUE
),
/* Reported by Paul Ortyl <ortylp@3miasto.net>
* Note that it's similar to the device above, only different prodID */
UNUSUAL_DEV
(
0x052b
,
0x1911
,
0x0100
,
0x0100
,
"Tekom Technologies, Inc"
,
"400_CAMERA"
,
US_SC_DEVICE
,
US_PR_DEVICE
,
NULL
,
US_FL_IGNORE_RESIDUE
),
/* This entry is needed because the device reports Sub=ff */
UNUSUAL_DEV
(
0x054c
,
0x0010
,
0x0106
,
0x0450
,
"Sony"
,
...
...
drivers/usb/storage/usb.c
View file @
0137957a
...
...
@@ -50,6 +50,7 @@
#include <linux/config.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/suspend.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
...
...
@@ -317,8 +318,8 @@ static int usb_stor_control_thread(void * __us)
/* lock access to the state */
scsi_lock
(
host
);
/* has the command
been aborted
*already* ? */
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
{
/* has the command
timed out
*already* ? */
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
{
us
->
srb
->
result
=
DID_ABORT
<<
16
;
goto
SkipForAbort
;
}
...
...
@@ -329,8 +330,6 @@ static int usb_stor_control_thread(void * __us)
goto
SkipForDisconnect
;
}
/* set the state and release the lock */
us
->
sm_state
=
US_STATE_RUNNING
;
scsi_unlock
(
host
);
/* reject the command if the direction indicator
...
...
@@ -391,16 +390,15 @@ static int usb_stor_control_thread(void * __us)
/* If an abort request was received we need to signal that
* the abort has finished. The proper test for this is
*
sm_state == US_STATE_ABORTING, not srb->result == DID_ABORT,
*
because an
abort request might be received after all the
*
the TIMED_OUT flag, not srb->result == DID_ABORT, because
*
a timeout/
abort request might be received after all the
* USB processing was complete. */
if
(
us
->
sm_state
==
US_STATE_ABORTING
)
if
(
test_bit
(
US_FLIDX_TIMED_OUT
,
&
us
->
flags
)
)
complete
(
&
(
us
->
notify
));
/*
empty the queue, reset the state, and release the lock
*/
/*
finished working on this command
*/
SkipForDisconnect:
us
->
srb
=
NULL
;
us
->
sm_state
=
US_STATE_IDLE
;
scsi_unlock
(
host
);
/* unlock the device pointers */
...
...
@@ -800,7 +798,6 @@ static int usb_stor_acquire_resources(struct us_data *us)
us
->
host
->
hostdata
[
0
]
=
(
unsigned
long
)
us
;
/* Start up our control thread */
us
->
sm_state
=
US_STATE_IDLE
;
p
=
kernel_thread
(
usb_stor_control_thread
,
us
,
CLONE_VM
);
if
(
p
<
0
)
{
printk
(
KERN_WARNING
USB_STORAGE
...
...
@@ -828,7 +825,6 @@ void usb_stor_release_resources(struct us_data *us)
/* Wait for the thread to be idle */
down
(
&
us
->
dev_semaphore
);
US_DEBUGP
(
"-- sending exit command to thread
\n
"
);
BUG_ON
(
us
->
sm_state
!=
US_STATE_IDLE
);
/* If the SCSI midlayer queued a final command just before
* scsi_remove_host() was called, us->srb might not be
...
...
@@ -897,8 +893,7 @@ static int usb_stor_scan_thread(void * __us)
* so get rid of all our resources.
*/
lock_kernel
();
daemonize
(
"usb-stor"
);
current
->
flags
|=
PF_NOFREEZE
;
daemonize
(
"usb-stor-scan"
);
unlock_kernel
();
printk
(
KERN_DEBUG
...
...
@@ -908,9 +903,14 @@ static int usb_stor_scan_thread(void * __us)
if
(
delay_use
>
0
)
{
printk
(
KERN_DEBUG
"usb-storage: waiting for device "
"to settle before scanning
\n
"
);
retry:
wait_event_interruptible_timeout
(
us
->
scsi_scan_wait
,
test_bit
(
US_FLIDX_DISCONNECTING
,
&
us
->
flags
),
delay_use
*
HZ
);
if
(
current
->
flags
&
PF_FREEZE
)
{
refrigerator
(
PF_FREEZE
);
goto
retry
;
}
}
/* If the device is still connected, perform the scanning */
...
...
drivers/usb/storage/usb.h
View file @
0137957a
...
...
@@ -83,14 +83,9 @@ struct us_unusual_dev {
#define ABORTING_OR_DISCONNECTING ((1UL << US_FLIDX_ABORTING) | \
(1UL << US_FLIDX_DISCONNECTING))
#define US_FLIDX_RESETTING 22
/* 0x00400000 device reset in progress */
#define US_FLIDX_TIMED_OUT 23
/* 0x00800000 SCSI midlayer timed out */
/* processing state machine states */
#define US_STATE_IDLE 1
#define US_STATE_RUNNING 2
#define US_STATE_RESETTING 3
#define US_STATE_ABORTING 4
#define USB_STOR_STRING_LEN 32
/*
...
...
@@ -148,7 +143,6 @@ struct us_data {
/* thread information */
int
pid
;
/* control thread */
int
sm_state
;
/* what we are doing */
/* control and bulk communications data */
struct
urb
*
current_urb
;
/* USB requests */
...
...
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