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
da192bb5
Commit
da192bb5
authored
Sep 22, 2005
by
Jeff Garzik
Browse files
Options
Browse Files
Download
Plain Diff
Merge /spare/repo/linux-2.6/
parents
af9288a7
3fd07d3b
Changes
26
Show whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
252 additions
and
220 deletions
+252
-220
Documentation/usb/URB.txt
Documentation/usb/URB.txt
+31
-43
MAINTAINERS
MAINTAINERS
+0
-2
arch/ppc/syslib/ppc85xx_setup.c
arch/ppc/syslib/ppc85xx_setup.c
+4
-4
drivers/base/class.c
drivers/base/class.c
+13
-0
drivers/base/dd.c
drivers/base/dd.c
+3
-0
drivers/block/ub.c
drivers/block/ub.c
+29
-26
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_main.c
+2
-1
drivers/net/r8169.c
drivers/net/r8169.c
+2
-2
drivers/net/skge.c
drivers/net/skge.c
+91
-103
drivers/net/skge.h
drivers/net/skge.h
+2
-0
drivers/pci/hotplug.c
drivers/pci/hotplug.c
+0
-4
drivers/pci/hotplug/rpadlpar_sysfs.c
drivers/pci/hotplug/rpadlpar_sysfs.c
+2
-2
drivers/pci/hotplug/sgi_hotplug.c
drivers/pci/hotplug/sgi_hotplug.c
+3
-3
drivers/pci/pci-sysfs.c
drivers/pci/pci-sysfs.c
+1
-1
drivers/pci/probe.c
drivers/pci/probe.c
+2
-2
drivers/s390/cio/ccwgroup.c
drivers/s390/cio/ccwgroup.c
+1
-1
drivers/usb/core/message.c
drivers/usb/core/message.c
+1
-1
drivers/usb/core/usb.c
drivers/usb/core/usb.c
+3
-3
drivers/usb/gadget/pxa2xx_udc.c
drivers/usb/gadget/pxa2xx_udc.c
+2
-2
drivers/usb/gadget/pxa2xx_udc.h
drivers/usb/gadget/pxa2xx_udc.h
+4
-4
drivers/usb/host/sl811-hcd.c
drivers/usb/host/sl811-hcd.c
+14
-2
drivers/usb/net/pegasus.c
drivers/usb/net/pegasus.c
+20
-9
drivers/usb/serial/airprime.c
drivers/usb/serial/airprime.c
+2
-1
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/ftdi_sio.c
+5
-3
drivers/usb/serial/option.c
drivers/usb/serial/option.c
+10
-1
include/linux/device.h
include/linux/device.h
+5
-0
No files found.
Documentation/usb/URB.txt
View file @
da192bb5
Revised: 2000-Dec-05.
Revised: 2000-Dec-05.
Again: 2002-Jul-06
Again: 2002-Jul-06
Again: 2005-Sep-19
NOTE:
NOTE:
...
@@ -18,8 +19,8 @@ called USB Request Block, or URB for short.
...
@@ -18,8 +19,8 @@ called USB Request Block, or URB for short.
and deliver the data and status back.
and deliver the data and status back.
- Execution of an URB is inherently an asynchronous operation, i.e. the
- Execution of an URB is inherently an asynchronous operation, i.e. the
usb_submit_urb(urb) call returns immediately after it has successfully
queued
usb_submit_urb(urb) call returns immediately after it has successfully
the requested action.
queued the requested action.
- Transfers for one URB can be canceled with usb_unlink_urb(urb) at any time.
- Transfers for one URB can be canceled with usb_unlink_urb(urb) at any time.
...
@@ -94,8 +95,9 @@ To free an URB, use
...
@@ -94,8 +95,9 @@ To free an URB, use
void usb_free_urb(struct urb *urb)
void usb_free_urb(struct urb *urb)
You may not free an urb that you've submitted, but which hasn't yet been
You may free an urb that you've submitted, but which hasn't yet been
returned to you in a completion callback.
returned to you in a completion callback. It will automatically be
deallocated when it is no longer in use.
1.4. What has to be filled in?
1.4. What has to be filled in?
...
@@ -145,30 +147,36 @@ to get seamless ISO streaming.
...
@@ -145,30 +147,36 @@ to get seamless ISO streaming.
1.6. How to cancel an already running URB?
1.6. How to cancel an already running URB?
For an URB which you've submitted, but which hasn't been returned to
There are two ways to cancel an URB you've submitted but which hasn't
your driver by the host controller
, call
been returned to your driver yet. For an asynchronous cancel
, call
int usb_unlink_urb(struct urb *urb)
int usb_unlink_urb(struct urb *urb)
It removes the urb from the internal list and frees all allocated
It removes the urb from the internal list and frees all allocated
HW descriptors. The status is changed to reflect unlinking.
After
HW descriptors. The status is changed to reflect unlinking.
Note
usb_unlink_urb() returns with that status code, you can free the URB
that the URB will not normally have finished when usb_unlink_urb()
with usb_free_urb()
.
returns; you must still wait for the completion handler to be called
.
There is also an asynchronous unlink mode. To use this, set the
To cancel an URB synchronously, call
the URB_ASYNC_UNLINK flag in urb->transfer flags before calling
usb_unlink_urb(). When using async unlinking, the URB will not
void usb_kill_urb(struct urb *urb)
normally be unlinked when usb_unlink_urb() returns. Instead, wait
for the completion handler to be called.
It does everything usb_unlink_urb does, and in addition it waits
until after the URB has been returned and the completion handler
has finished. It also marks the URB as temporarily unusable, so
that if the completion handler or anyone else tries to resubmit it
they will get a -EPERM error. Thus you can be sure that when
usb_kill_urb() returns, the URB is totally idle.
1.7. What about the completion handler?
1.7. What about the completion handler?
The handler is of the following type:
The handler is of the following type:
typedef void (*usb_complete_t)(struct urb *
);
typedef void (*usb_complete_t)(struct urb *
, struct pt_regs *)
i.e. it gets just the URB that caused the completion call.
I.e., it gets the URB that caused the completion call, plus the
register values at the time of the corresponding interrupt (if any).
In the completion handler, you should have a look at urb->status to
In the completion handler, you should have a look at urb->status to
detect any USB errors. Since the context parameter is included in the URB,
detect any USB errors. Since the context parameter is included in the URB,
you can pass information to the completion handler.
you can pass information to the completion handler.
...
@@ -176,17 +184,11 @@ you can pass information to the completion handler.
...
@@ -176,17 +184,11 @@ you can pass information to the completion handler.
Note that even when an error (or unlink) is reported, data may have been
Note that even when an error (or unlink) is reported, data may have been
transferred. That's because USB transfers are packetized; it might take
transferred. That's because USB transfers are packetized; it might take
sixteen packets to transfer your 1KByte buffer, and ten of them might
sixteen packets to transfer your 1KByte buffer, and ten of them might
have transferred succesfully before the completion
i
s called.
have transferred succesfully before the completion
wa
s called.
NOTE: ***** WARNING *****
NOTE: ***** WARNING *****
Don't use urb->dev field in your completion handler; it's cleared
NEVER SLEEP IN A COMPLETION HANDLER. These are normally called
as part of giving urbs back to drivers. (Addressing an issue with
ownership of periodic URBs, which was otherwise ambiguous.) Instead,
use urb->context to hold all the data your driver needs.
NOTE: ***** WARNING *****
Also, NEVER SLEEP IN A COMPLETION HANDLER. These are normally called
during hardware interrupt processing. If you can, defer substantial
during hardware interrupt processing. If you can, defer substantial
work to a tasklet (bottom half) to keep system latencies low. You'll
work to a tasklet (bottom half) to keep system latencies low. You'll
probably need to use spinlocks to protect data structures you manipulate
probably need to use spinlocks to protect data structures you manipulate
...
@@ -229,24 +231,10 @@ ISO data with some other event stream.
...
@@ -229,24 +231,10 @@ ISO data with some other event stream.
Interrupt transfers, like isochronous transfers, are periodic, and happen
Interrupt transfers, like isochronous transfers, are periodic, and happen
in intervals that are powers of two (1, 2, 4 etc) units. Units are frames
in intervals that are powers of two (1, 2, 4 etc) units. Units are frames
for full and low speed devices, and microframes for high speed ones.
for full and low speed devices, and microframes for high speed ones.
Currently, after you submit one interrupt URB, that urb is owned by the
host controller driver until you cancel it with usb_unlink_urb(). You
may unlink interrupt urbs in their completion handlers, if you need to.
After a transfer completion is called, the URB is automagically resubmitted.
THIS BEHAVIOR IS EXPECTED TO BE REMOVED!!
Interrupt transfers may only send (or receive) the "maxpacket" value for
the given interrupt endpoint; if you need more data, you will need to
copy that data out of (or into) another buffer. Similarly, you can't
queue interrupt transfers.
THESE RESTRICTIONS ARE EXPECTED TO BE REMOVED!!
Note that this automagic resubmission model does make it awkward to use
interrupt OUT transfers. The portable solution involves unlinking those
OUT urbs after the data is transferred, and perhaps submitting a final
URB for a short packet.
The usb_submit_urb() call modifies urb->interval to the implemented interval
The usb_submit_urb() call modifies urb->interval to the implemented interval
value that is less than or equal to the requested interval value.
value that is less than or equal to the requested interval value.
In Linux 2.6, unlike earlier versions, interrupt URBs are not automagically
restarted when they complete. They end when the completion handler is
called, just like other URBs. If you want an interrupt URB to be restarted,
your completion handler must resubmit it.
MAINTAINERS
View file @
da192bb5
...
@@ -1063,8 +1063,6 @@ M: wli@holomorphy.com
...
@@ -1063,8 +1063,6 @@ M: wli@holomorphy.com
S: Maintained
S: Maintained
I2C SUBSYSTEM
I2C SUBSYSTEM
P: Greg Kroah-Hartman
M: greg@kroah.com
P: Jean Delvare
P: Jean Delvare
M: khali@linux-fr.org
M: khali@linux-fr.org
L: lm-sensors@lm-sensors.org
L: lm-sensors@lm-sensors.org
...
...
arch/ppc/syslib/ppc85xx_setup.c
View file @
da192bb5
...
@@ -184,8 +184,8 @@ mpc85xx_setup_pci1(struct pci_controller *hose)
...
@@ -184,8 +184,8 @@ mpc85xx_setup_pci1(struct pci_controller *hose)
pci
->
powar1
=
0x80044000
|
pci
->
powar1
=
0x80044000
|
(
__ilog2
(
MPC85XX_PCI1_UPPER_MEM
-
MPC85XX_PCI1_LOWER_MEM
+
1
)
-
1
);
(
__ilog2
(
MPC85XX_PCI1_UPPER_MEM
-
MPC85XX_PCI1_LOWER_MEM
+
1
)
-
1
);
/* Setup outboud IO windows @ MPC85XX_PCI1_IO_BASE */
/* Setup outbou
n
d IO windows @ MPC85XX_PCI1_IO_BASE */
pci
->
potar2
=
0x00000000
;
pci
->
potar2
=
(
MPC85XX_PCI1_LOWER_IO
>>
12
)
&
0x000fffff
;
pci
->
potear2
=
0x00000000
;
pci
->
potear2
=
0x00000000
;
pci
->
powbar2
=
(
MPC85XX_PCI1_IO_BASE
>>
12
)
&
0x000fffff
;
pci
->
powbar2
=
(
MPC85XX_PCI1_IO_BASE
>>
12
)
&
0x000fffff
;
/* Enable, IO R/W */
/* Enable, IO R/W */
...
@@ -235,8 +235,8 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
...
@@ -235,8 +235,8 @@ mpc85xx_setup_pci2(struct pci_controller *hose)
pci
->
powar1
=
0x80044000
|
pci
->
powar1
=
0x80044000
|
(
__ilog2
(
MPC85XX_PCI2_UPPER_MEM
-
MPC85XX_PCI2_LOWER_MEM
+
1
)
-
1
);
(
__ilog2
(
MPC85XX_PCI2_UPPER_MEM
-
MPC85XX_PCI2_LOWER_MEM
+
1
)
-
1
);
/* Setup outboud IO windows @ MPC85XX_PCI2_IO_BASE */
/* Setup outbou
n
d IO windows @ MPC85XX_PCI2_IO_BASE */
pci
->
potar2
=
0x00000000
;
pci
->
potar2
=
(
MPC85XX_PCI2_LOWER_IO
>>
12
)
&
0x000fffff
;
;
pci
->
potear2
=
0x00000000
;
pci
->
potear2
=
0x00000000
;
pci
->
powbar2
=
(
MPC85XX_PCI2_IO_BASE
>>
12
)
&
0x000fffff
;
pci
->
powbar2
=
(
MPC85XX_PCI2_IO_BASE
>>
12
)
&
0x000fffff
;
/* Enable, IO R/W */
/* Enable, IO R/W */
...
...
drivers/base/class.c
View file @
da192bb5
...
@@ -669,6 +669,7 @@ void class_device_destroy(struct class *cls, dev_t devt)
...
@@ -669,6 +669,7 @@ void class_device_destroy(struct class *cls, dev_t devt)
int
class_device_rename
(
struct
class_device
*
class_dev
,
char
*
new_name
)
int
class_device_rename
(
struct
class_device
*
class_dev
,
char
*
new_name
)
{
{
int
error
=
0
;
int
error
=
0
;
char
*
old_class_name
=
NULL
,
*
new_class_name
=
NULL
;
class_dev
=
class_device_get
(
class_dev
);
class_dev
=
class_device_get
(
class_dev
);
if
(
!
class_dev
)
if
(
!
class_dev
)
...
@@ -677,12 +678,24 @@ int class_device_rename(struct class_device *class_dev, char *new_name)
...
@@ -677,12 +678,24 @@ int class_device_rename(struct class_device *class_dev, char *new_name)
pr_debug
(
"CLASS: renaming '%s' to '%s'
\n
"
,
class_dev
->
class_id
,
pr_debug
(
"CLASS: renaming '%s' to '%s'
\n
"
,
class_dev
->
class_id
,
new_name
);
new_name
);
if
(
class_dev
->
dev
)
old_class_name
=
make_class_name
(
class_dev
);
strlcpy
(
class_dev
->
class_id
,
new_name
,
KOBJ_NAME_LEN
);
strlcpy
(
class_dev
->
class_id
,
new_name
,
KOBJ_NAME_LEN
);
error
=
kobject_rename
(
&
class_dev
->
kobj
,
new_name
);
error
=
kobject_rename
(
&
class_dev
->
kobj
,
new_name
);
if
(
class_dev
->
dev
)
{
new_class_name
=
make_class_name
(
class_dev
);
sysfs_create_link
(
&
class_dev
->
dev
->
kobj
,
&
class_dev
->
kobj
,
new_class_name
);
sysfs_remove_link
(
&
class_dev
->
dev
->
kobj
,
old_class_name
);
}
class_device_put
(
class_dev
);
class_device_put
(
class_dev
);
kfree
(
old_class_name
);
kfree
(
new_class_name
);
return
error
;
return
error
;
}
}
...
...
drivers/base/dd.c
View file @
da192bb5
...
@@ -40,6 +40,9 @@
...
@@ -40,6 +40,9 @@
*/
*/
void
device_bind_driver
(
struct
device
*
dev
)
void
device_bind_driver
(
struct
device
*
dev
)
{
{
if
(
klist_node_attached
(
&
dev
->
knode_driver
))
return
;
pr_debug
(
"bound device '%s' to driver '%s'
\n
"
,
pr_debug
(
"bound device '%s' to driver '%s'
\n
"
,
dev
->
bus_id
,
dev
->
driver
->
name
);
dev
->
bus_id
,
dev
->
driver
->
name
);
klist_add_tail
(
&
dev
->
knode_driver
,
&
dev
->
driver
->
klist_devices
);
klist_add_tail
(
&
dev
->
knode_driver
,
&
dev
->
driver
->
klist_devices
);
...
...
drivers/block/ub.c
View file @
da192bb5
...
@@ -172,7 +172,7 @@ struct bulk_cs_wrap {
...
@@ -172,7 +172,7 @@ struct bulk_cs_wrap {
*/
*/
struct
ub_dev
;
struct
ub_dev
;
#define UB_MAX_REQ_SG
4
#define UB_MAX_REQ_SG
9
/* cdrecord requires 32KB and maybe a header */
#define UB_MAX_SECTORS 64
#define UB_MAX_SECTORS 64
/*
/*
...
@@ -387,7 +387,7 @@ struct ub_dev {
...
@@ -387,7 +387,7 @@ struct ub_dev {
struct
bulk_cs_wrap
work_bcs
;
struct
bulk_cs_wrap
work_bcs
;
struct
usb_ctrlrequest
work_cr
;
struct
usb_ctrlrequest
work_cr
;
int
sg_stat
[
UB_MAX_REQ_SG
+
1
];
int
sg_stat
[
6
];
struct
ub_scsi_trace
tr
;
struct
ub_scsi_trace
tr
;
};
};
...
@@ -525,12 +525,13 @@ static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr,
...
@@ -525,12 +525,13 @@ static ssize_t ub_diag_show(struct device *dev, struct device_attribute *attr,
"qlen %d qmax %d
\n
"
,
"qlen %d qmax %d
\n
"
,
sc
->
cmd_queue
.
qlen
,
sc
->
cmd_queue
.
qmax
);
sc
->
cmd_queue
.
qlen
,
sc
->
cmd_queue
.
qmax
);
cnt
+=
sprintf
(
page
+
cnt
,
cnt
+=
sprintf
(
page
+
cnt
,
"sg %d %d %d %d %d
\n
"
,
"sg %d %d %d %d %d
.. %d
\n
"
,
sc
->
sg_stat
[
0
],
sc
->
sg_stat
[
0
],
sc
->
sg_stat
[
1
],
sc
->
sg_stat
[
1
],
sc
->
sg_stat
[
2
],
sc
->
sg_stat
[
2
],
sc
->
sg_stat
[
3
],
sc
->
sg_stat
[
3
],
sc
->
sg_stat
[
4
]);
sc
->
sg_stat
[
4
],
sc
->
sg_stat
[
5
]);
list_for_each
(
p
,
&
sc
->
luns
)
{
list_for_each
(
p
,
&
sc
->
luns
)
{
lun
=
list_entry
(
p
,
struct
ub_lun
,
link
);
lun
=
list_entry
(
p
,
struct
ub_lun
,
link
);
...
@@ -835,7 +836,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
...
@@ -835,7 +836,7 @@ static int ub_cmd_build_block(struct ub_dev *sc, struct ub_lun *lun,
return
-
1
;
return
-
1
;
}
}
cmd
->
nsg
=
n_elem
;
cmd
->
nsg
=
n_elem
;
sc
->
sg_stat
[
n_elem
]
++
;
sc
->
sg_stat
[
n_elem
<
5
?
n_elem
:
5
]
++
;
/*
/*
* build the command
* build the command
...
@@ -891,7 +892,7 @@ static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
...
@@ -891,7 +892,7 @@ static int ub_cmd_build_packet(struct ub_dev *sc, struct ub_lun *lun,
return
-
1
;
return
-
1
;
}
}
cmd
->
nsg
=
n_elem
;
cmd
->
nsg
=
n_elem
;
sc
->
sg_stat
[
n_elem
]
++
;
sc
->
sg_stat
[
n_elem
<
5
?
n_elem
:
5
]
++
;
memcpy
(
&
cmd
->
cdb
,
rq
->
cmd
,
rq
->
cmd_len
);
memcpy
(
&
cmd
->
cdb
,
rq
->
cmd
,
rq
->
cmd_len
);
cmd
->
cdb_len
=
rq
->
cmd_len
;
cmd
->
cdb_len
=
rq
->
cmd_len
;
...
@@ -1010,7 +1011,6 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
...
@@ -1010,7 +1011,6 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
sc
->
last_pipe
=
sc
->
send_bulk_pipe
;
sc
->
last_pipe
=
sc
->
send_bulk_pipe
;
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_bulk_pipe
,
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_bulk_pipe
,
bcb
,
US_BULK_CB_WRAP_LEN
,
ub_urb_complete
,
sc
);
bcb
,
US_BULK_CB_WRAP_LEN
,
ub_urb_complete
,
sc
);
sc
->
work_urb
.
transfer_flags
=
0
;
/* Fill what we shouldn't be filling, because usb-storage did so. */
/* Fill what we shouldn't be filling, because usb-storage did so. */
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
...
@@ -1019,7 +1019,6 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
...
@@ -1019,7 +1019,6 @@ static int ub_scsi_cmd_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_ATOMIC
))
!=
0
)
{
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_ATOMIC
))
!=
0
)
{
/* XXX Clear stalls */
/* XXX Clear stalls */
printk
(
"ub: cmd #%d start failed (%d)
\n
"
,
cmd
->
tag
,
rc
);
/* P3 */
ub_complete
(
&
sc
->
work_done
);
ub_complete
(
&
sc
->
work_done
);
return
rc
;
return
rc
;
}
}
...
@@ -1190,11 +1189,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
...
@@ -1190,11 +1189,9 @@ static void ub_scsi_urb_compl(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
return
;
return
;
}
}
if
(
urb
->
status
!=
0
)
{
if
(
urb
->
status
!=
0
)
{
printk
(
"ub: cmd #%d cmd status (%d)
\n
"
,
cmd
->
tag
,
urb
->
status
);
/* P3 */
goto
Bad_End
;
goto
Bad_End
;
}
}
if
(
urb
->
actual_length
!=
US_BULK_CB_WRAP_LEN
)
{
if
(
urb
->
actual_length
!=
US_BULK_CB_WRAP_LEN
)
{
printk
(
"ub: cmd #%d xferred %d
\n
"
,
cmd
->
tag
,
urb
->
actual_length
);
/* P3 */
/* XXX Must do reset here to unconfuse the device */
/* XXX Must do reset here to unconfuse the device */
goto
Bad_End
;
goto
Bad_End
;
}
}
...
@@ -1395,14 +1392,12 @@ static void ub_data_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
...
@@ -1395,14 +1392,12 @@ static void ub_data_start(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
pipe
,
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
pipe
,
page_address
(
sg
->
page
)
+
sg
->
offset
,
sg
->
length
,
page_address
(
sg
->
page
)
+
sg
->
offset
,
sg
->
length
,
ub_urb_complete
,
sc
);
ub_urb_complete
,
sc
);
sc
->
work_urb
.
transfer_flags
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
status
=
0
;
sc
->
work_urb
.
status
=
0
;
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_ATOMIC
))
!=
0
)
{
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_ATOMIC
))
!=
0
)
{
/* XXX Clear stalls */
/* XXX Clear stalls */
printk
(
"ub: data #%d submit failed (%d)
\n
"
,
cmd
->
tag
,
rc
);
/* P3 */
ub_complete
(
&
sc
->
work_done
);
ub_complete
(
&
sc
->
work_done
);
ub_state_done
(
sc
,
cmd
,
rc
);
ub_state_done
(
sc
,
cmd
,
rc
);
return
;
return
;
...
@@ -1442,7 +1437,6 @@ static int __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
...
@@ -1442,7 +1437,6 @@ static int __ub_state_stat(struct ub_dev *sc, struct ub_scsi_cmd *cmd)
sc
->
last_pipe
=
sc
->
recv_bulk_pipe
;
sc
->
last_pipe
=
sc
->
recv_bulk_pipe
;
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
recv_bulk_pipe
,
usb_fill_bulk_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
recv_bulk_pipe
,
&
sc
->
work_bcs
,
US_BULK_CS_WRAP_LEN
,
ub_urb_complete
,
sc
);
&
sc
->
work_bcs
,
US_BULK_CS_WRAP_LEN
,
ub_urb_complete
,
sc
);
sc
->
work_urb
.
transfer_flags
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
status
=
0
;
sc
->
work_urb
.
status
=
0
;
...
@@ -1563,7 +1557,6 @@ static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
...
@@ -1563,7 +1557,6 @@ static int ub_submit_clear_stall(struct ub_dev *sc, struct ub_scsi_cmd *cmd,
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_ctrl_pipe
,
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_ctrl_pipe
,
(
unsigned
char
*
)
cr
,
NULL
,
0
,
ub_urb_complete
,
sc
);
(
unsigned
char
*
)
cr
,
NULL
,
0
,
ub_urb_complete
,
sc
);
sc
->
work_urb
.
transfer_flags
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
status
=
0
;
sc
->
work_urb
.
status
=
0
;
...
@@ -2000,17 +1993,16 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
...
@@ -2000,17 +1993,16 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
recv_ctrl_pipe
,
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
recv_ctrl_pipe
,
(
unsigned
char
*
)
cr
,
p
,
1
,
ub_probe_urb_complete
,
&
compl
);
(
unsigned
char
*
)
cr
,
p
,
1
,
ub_probe_urb_complete
,
&
compl
);
sc
->
work_urb
.
transfer_flags
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
status
=
0
;
sc
->
work_urb
.
status
=
0
;
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_KERNEL
))
!=
0
)
{
if
((
rc
=
usb_submit_urb
(
&
sc
->
work_urb
,
GFP_KERNEL
))
!=
0
)
{
if
(
rc
==
-
EPIPE
)
{
if
(
rc
==
-
EPIPE
)
{
printk
(
"%s: Stall
at
GetMaxLUN, using 1 LUN
\n
"
,
printk
(
"%s: Stall
submitting
GetMaxLUN, using 1 LUN
\n
"
,
sc
->
name
);
/* P3 */
sc
->
name
);
/* P3 */
}
else
{
}
else
{
printk
(
KERN_
WARNING
printk
(
KERN_
NOTICE
"%s: Unable to submit GetMaxLUN (%d)
\n
"
,
"%s: Unable to submit GetMaxLUN (%d)
\n
"
,
sc
->
name
,
rc
);
sc
->
name
,
rc
);
}
}
...
@@ -2028,6 +2020,18 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
...
@@ -2028,6 +2020,18 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
del_timer_sync
(
&
timer
);
del_timer_sync
(
&
timer
);
usb_kill_urb
(
&
sc
->
work_urb
);
usb_kill_urb
(
&
sc
->
work_urb
);
if
((
rc
=
sc
->
work_urb
.
status
)
<
0
)
{
if
(
rc
==
-
EPIPE
)
{
printk
(
"%s: Stall at GetMaxLUN, using 1 LUN
\n
"
,
sc
->
name
);
/* P3 */
}
else
{
printk
(
KERN_NOTICE
"%s: Error at GetMaxLUN (%d)
\n
"
,
sc
->
name
,
rc
);
}
goto
err_io
;
}
if
(
sc
->
work_urb
.
actual_length
!=
1
)
{
if
(
sc
->
work_urb
.
actual_length
!=
1
)
{
printk
(
"%s: GetMaxLUN returned %d bytes
\n
"
,
sc
->
name
,
printk
(
"%s: GetMaxLUN returned %d bytes
\n
"
,
sc
->
name
,
sc
->
work_urb
.
actual_length
);
/* P3 */
sc
->
work_urb
.
actual_length
);
/* P3 */
...
@@ -2048,6 +2052,7 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
...
@@ -2048,6 +2052,7 @@ static int ub_sync_getmaxlun(struct ub_dev *sc)
kfree
(
p
);
kfree
(
p
);
return
nluns
;
return
nluns
;
err_io:
err_submit:
err_submit:
kfree
(
p
);
kfree
(
p
);
err_alloc:
err_alloc:
...
@@ -2080,7 +2085,6 @@ static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe)
...
@@ -2080,7 +2085,6 @@ static int ub_probe_clear_stall(struct ub_dev *sc, int stalled_pipe)
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_ctrl_pipe
,
usb_fill_control_urb
(
&
sc
->
work_urb
,
sc
->
dev
,
sc
->
send_ctrl_pipe
,
(
unsigned
char
*
)
cr
,
NULL
,
0
,
ub_probe_urb_complete
,
&
compl
);
(
unsigned
char
*
)
cr
,
NULL
,
0
,
ub_probe_urb_complete
,
&
compl
);
sc
->
work_urb
.
transfer_flags
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
actual_length
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
error_count
=
0
;
sc
->
work_urb
.
status
=
0
;
sc
->
work_urb
.
status
=
0
;
...
@@ -2213,8 +2217,10 @@ static int ub_probe(struct usb_interface *intf,
...
@@ -2213,8 +2217,10 @@ static int ub_probe(struct usb_interface *intf,
* This is needed to clear toggles. It is a problem only if we do
* This is needed to clear toggles. It is a problem only if we do
* `rmmod ub && modprobe ub` without disconnects, but we like that.
* `rmmod ub && modprobe ub` without disconnects, but we like that.
*/
*/
#if 0 /* iPod Mini fails if we do this (big white iPod works) */
ub_probe_clear_stall(sc, sc->recv_bulk_pipe);
ub_probe_clear_stall(sc, sc->recv_bulk_pipe);
ub_probe_clear_stall(sc, sc->send_bulk_pipe);
ub_probe_clear_stall(sc, sc->send_bulk_pipe);
#endif
/*
/*
* The way this is used by the startup code is a little specific.
* The way this is used by the startup code is a little specific.
...
@@ -2241,10 +2247,10 @@ static int ub_probe(struct usb_interface *intf,
...
@@ -2241,10 +2247,10 @@ static int ub_probe(struct usb_interface *intf,
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
if
((
rc
=
ub_sync_getmaxlun
(
sc
))
<
0
)
{
if
((
rc
=
ub_sync_getmaxlun
(
sc
))
<
0
)
{
/*
/*
*
Some devices (i.e. Iomega Zip100) need this --
*
This segment is taken from usb-storage. They say
*
apparently the bulk pipes get STALLed when the
*
that ZIP-100 needs this, but my own ZIP-100 works
*
GetMaxLUN request is processed
.
*
fine without this
.
*
XXX I have a ZIP-100, verify it does this
.
*
Still, it does not seem to hurt anything
.
*/
*/
if
(
rc
==
-
EPIPE
)
{
if
(
rc
==
-
EPIPE
)
{
ub_probe_clear_stall
(
sc
,
sc
->
recv_bulk_pipe
);
ub_probe_clear_stall
(
sc
,
sc
->
recv_bulk_pipe
);
...
@@ -2313,7 +2319,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
...
@@ -2313,7 +2319,7 @@ static int ub_probe_lun(struct ub_dev *sc, int lnum)
disk
->
first_minor
=
lun
->
id
*
UB_MINORS_PER_MAJOR
;
disk
->
first_minor
=
lun
->
id
*
UB_MINORS_PER_MAJOR
;
disk
->
fops
=
&
ub_bd_fops
;
disk
->
fops
=
&
ub_bd_fops
;
disk
->
private_data
=
lun
;
disk
->
private_data
=
lun
;
disk
->
driverfs_dev
=
&
sc
->
intf
->
dev
;
/* XXX Many to one ok? */
disk
->
driverfs_dev
=
&
sc
->
intf
->
dev
;
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
if
((
q
=
blk_init_queue
(
ub_request_fn
,
&
sc
->
lock
))
==
NULL
)
if
((
q
=
blk_init_queue
(
ub_request_fn
,
&
sc
->
lock
))
==
NULL
)
...
@@ -2466,9 +2472,6 @@ static int __init ub_init(void)
...
@@ -2466,9 +2472,6 @@ static int __init ub_init(void)
{
{
int
rc
;
int
rc
;
/* P3 */
printk
(
"ub: sizeof ub_scsi_cmd %zu ub_dev %zu ub_lun %zu
\n
"
,
sizeof
(
struct
ub_scsi_cmd
),
sizeof
(
struct
ub_dev
),
sizeof
(
struct
ub_lun
));
if
((
rc
=
register_blkdev
(
UB_MAJOR
,
DRV_NAME
))
!=
0
)
if
((
rc
=
register_blkdev
(
UB_MAJOR
,
DRV_NAME
))
!=
0
)
goto
err_regblkdev
;
goto
err_regblkdev
;
devfs_mk_dir
(
DEVFS_NAME
);
devfs_mk_dir
(
DEVFS_NAME
);
...
...
drivers/net/bonding/bond_main.c
View file @
da192bb5
...
@@ -1653,7 +1653,8 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
...
@@ -1653,7 +1653,8 @@ static int bond_enslave(struct net_device *bond_dev, struct net_device *slave_de
int
old_features
=
bond_dev
->
features
;
int
old_features
=
bond_dev
->
features
;
int
res
=
0
;
int
res
=
0
;
if
(
slave_dev
->
do_ioctl
==
NULL
)
{
if
(
!
bond
->
params
.
use_carrier
&&
slave_dev
->
ethtool_ops
==
NULL
&&
slave_dev
->
do_ioctl
==
NULL
)
{
printk
(
KERN_WARNING
DRV_NAME
printk
(
KERN_WARNING
DRV_NAME
": Warning : no link monitoring support for %s
\n
"
,
": Warning : no link monitoring support for %s
\n
"
,
slave_dev
->
name
);
slave_dev
->
name
);
...
...
drivers/net/r8169.c
View file @
da192bb5
...
@@ -100,11 +100,11 @@ VERSION 2.2LK <2005/01/25>
...
@@ -100,11 +100,11 @@ VERSION 2.2LK <2005/01/25>
#ifdef CONFIG_R8169_NAPI
#ifdef CONFIG_R8169_NAPI
#define rtl8169_rx_skb netif_receive_skb
#define rtl8169_rx_skb netif_receive_skb
#define rtl8169_rx_hwaccel_skb vlan_hwaccel_r
x
#define rtl8169_rx_hwaccel_skb vlan_hwaccel_r
eceive_skb
#define rtl8169_rx_quota(count, quota) min(count, quota)
#define rtl8169_rx_quota(count, quota) min(count, quota)
#else
#else
#define rtl8169_rx_skb netif_rx
#define rtl8169_rx_skb netif_rx
#define rtl8169_rx_hwaccel_skb vlan_hwaccel_r
eceive_skb
#define rtl8169_rx_hwaccel_skb vlan_hwaccel_r
x
#define rtl8169_rx_quota(count, quota) count
#define rtl8169_rx_quota(count, quota) count
#endif
#endif
...
...
drivers/net/skge.c
View file @
da192bb5
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#include "skge.h"
#include "skge.h"
#define DRV_NAME "skge"
#define DRV_NAME "skge"
#define DRV_VERSION "1.
0
"
#define DRV_VERSION "1.
1
"
#define PFX DRV_NAME " "
#define PFX DRV_NAME " "
#define DEFAULT_TX_RING_SIZE 128
#define DEFAULT_TX_RING_SIZE 128
...
@@ -105,41 +105,28 @@ static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F };
...
@@ -105,41 +105,28 @@ static const u32 rxirqmask[] = { IS_R1_F, IS_R2_F };
static
const
u32
txirqmask
[]
=
{
IS_XA1_F
,
IS_XA2_F
};
static
const
u32
txirqmask
[]
=
{
IS_XA1_F
,
IS_XA2_F
};
static
const
u32
portirqmask
[]
=
{
IS_PORT_1
,
IS_PORT_2
};
static
const
u32
portirqmask
[]
=
{
IS_PORT_1
,
IS_PORT_2
};
/* Don't need to look at whole 16K.
* last interesting register is descriptor poll timer.
*/
#define SKGE_REGS_LEN (29*128)
static
int
skge_get_regs_len
(
struct
net_device
*
dev
)
static
int
skge_get_regs_len
(
struct
net_device
*
dev
)
{
{
return
SKGE_REGS_LEN
;
return
0x4000
;
}
}
/*
/*
* Returns copy of control register region
* Returns copy of whole control register region
* I/O region is divided into banks and certain regions are unreadable
* Note: skip RAM address register because accessing it will
* cause bus hangs!
*/
*/
static
void
skge_get_regs
(
struct
net_device
*
dev
,
struct
ethtool_regs
*
regs
,
static
void
skge_get_regs
(
struct
net_device
*
dev
,
struct
ethtool_regs
*
regs
,
void
*
p
)
void
*
p
)
{
{
const
struct
skge_port
*
skge
=
netdev_priv
(
dev
);
const
struct
skge_port
*
skge
=
netdev_priv
(
dev
);
unsigned
long
offs
;
const
void
__iomem
*
io
=
skge
->
hw
->
regs
;
const
void
__iomem
*
io
=
skge
->
hw
->
regs
;
static
const
unsigned
long
bankmap
=
(
1
<<
0
)
|
(
1
<<
2
)
|
(
1
<<
8
)
|
(
1
<<
9
)
|
(
1
<<
12
)
|
(
1
<<
13
)
|
(
1
<<
14
)
|
(
1
<<
15
)
|
(
1
<<
16
)
|
(
1
<<
17
)
|
(
1
<<
20
)
|
(
1
<<
21
)
|
(
1
<<
22
)
|
(
1
<<
23
)
|
(
1
<<
24
)
|
(
1
<<
25
)
|
(
1
<<
26
)
|
(
1
<<
27
)
|
(
1
<<
28
);
regs
->
version
=
1
;
regs
->
version
=
1
;
for
(
offs
=
0
;
offs
<
regs
->
len
;
offs
+=
128
)
{
memset
(
p
,
0
,
regs
->
len
);
u32
len
=
min_t
(
u32
,
128
,
regs
->
len
-
offs
);
memcpy_fromio
(
p
,
io
,
B3_RAM_ADDR
);
if
(
bankmap
&
(
1
<<
(
offs
/
128
)))
memcpy_fromio
(
p
+
B3_RI_WTO_R1
,
io
+
B3_RI_WTO_R1
,
memcpy_fromio
(
p
+
offs
,
io
+
offs
,
len
);
regs
->
len
-
B3_RI_WTO_R1
);
else
memset
(
p
+
offs
,
0
,
len
);
}
}
}
/* Wake on Lan only supported on Yukon chps with rev 1 or above */
/* Wake on Lan only supported on Yukon chps with rev 1 or above */
...
@@ -776,17 +763,6 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base)
...
@@ -776,17 +763,6 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u64 base)
return
0
;
return
0
;
}
}
static
struct
sk_buff
*
skge_rx_alloc
(
struct
net_device
*
dev
,
unsigned
int
size
)
{
struct
sk_buff
*
skb
=
dev_alloc_skb
(
size
);
if
(
likely
(
skb
))
{
skb
->
dev
=
dev
;
skb_reserve
(
skb
,
NET_IP_ALIGN
);
}
return
skb
;
}
/* Allocate and setup a new buffer for receiving */
/* Allocate and setup a new buffer for receiving */
static
void
skge_rx_setup
(
struct
skge_port
*
skge
,
struct
skge_element
*
e
,
static
void
skge_rx_setup
(
struct
skge_port
*
skge
,
struct
skge_element
*
e
,
struct
sk_buff
*
skb
,
unsigned
int
bufsize
)
struct
sk_buff
*
skb
,
unsigned
int
bufsize
)
...
@@ -859,16 +835,17 @@ static int skge_rx_fill(struct skge_port *skge)
...
@@ -859,16 +835,17 @@ static int skge_rx_fill(struct skge_port *skge)
{
{
struct
skge_ring
*
ring
=
&
skge
->
rx_ring
;
struct
skge_ring
*
ring
=
&
skge
->
rx_ring
;
struct
skge_element
*
e
;
struct
skge_element
*
e
;
unsigned
int
bufsize
=
skge
->
rx_buf_size
;
e
=
ring
->
start
;
e
=
ring
->
start
;
do
{
do
{
struct
sk_buff
*
skb
=
skge_rx_alloc
(
skge
->
netdev
,
bufsize
)
;
struct
sk_buff
*
skb
;
skb
=
dev_alloc_skb
(
skge
->
rx_buf_size
+
NET_IP_ALIGN
);
if
(
!
skb
)
if
(
!
skb
)
return
-
ENOMEM
;
return
-
ENOMEM
;
skge_rx_setup
(
skge
,
e
,
skb
,
bufsize
);
skb_reserve
(
skb
,
NET_IP_ALIGN
);
skge_rx_setup
(
skge
,
e
,
skb
,
skge
->
rx_buf_size
);
}
while
(
(
e
=
e
->
next
)
!=
ring
->
start
);
}
while
(
(
e
=
e
->
next
)
!=
ring
->
start
);
ring
->
to_clean
=
ring
->
start
;
ring
->
to_clean
=
ring
->
start
;
...
@@ -2443,6 +2420,14 @@ static void yukon_set_multicast(struct net_device *dev)
...
@@ -2443,6 +2420,14 @@ static void yukon_set_multicast(struct net_device *dev)
gma_write16
(
hw
,
port
,
GM_RX_CTRL
,
reg
);
gma_write16
(
hw
,
port
,
GM_RX_CTRL
,
reg
);
}
}
static
inline
u16
phy_length
(
const
struct
skge_hw
*
hw
,
u32
status
)
{
if
(
hw
->
chip_id
==
CHIP_ID_GENESIS
)
return
status
>>
XMR_FS_LEN_SHIFT
;
else
return
status
>>
GMR_FS_LEN_SHIFT
;
}
static
inline
int
bad_phy_status
(
const
struct
skge_hw
*
hw
,
u32
status
)
static
inline
int
bad_phy_status
(
const
struct
skge_hw
*
hw
,
u32
status
)
{
{
if
(
hw
->
chip_id
==
CHIP_ID_GENESIS
)
if
(
hw
->
chip_id
==
CHIP_ID_GENESIS
)
...
@@ -2452,80 +2437,99 @@ static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
...
@@ -2452,80 +2437,99 @@ static inline int bad_phy_status(const struct skge_hw *hw, u32 status)
(
status
&
GMR_FS_RX_OK
)
==
0
;
(
status
&
GMR_FS_RX_OK
)
==
0
;
}
}
static
void
skge_rx_error
(
struct
skge_port
*
skge
,
int
slot
,
u32
control
,
u32
status
)
{
if
(
netif_msg_rx_err
(
skge
))
printk
(
KERN_DEBUG
PFX
"%s: rx err, slot %d control 0x%x status 0x%x
\n
"
,
skge
->
netdev
->
name
,
slot
,
control
,
status
);
if
((
control
&
(
BMU_EOF
|
BMU_STF
))
!=
(
BMU_STF
|
BMU_EOF
))
skge
->
net_stats
.
rx_length_errors
++
;
else
if
(
skge
->
hw
->
chip_id
==
CHIP_ID_GENESIS
)
{
if
(
status
&
(
XMR_FS_RUNT
|
XMR_FS_LNG_ERR
))
skge
->
net_stats
.
rx_length_errors
++
;
if
(
status
&
XMR_FS_FRA_ERR
)
skge
->
net_stats
.
rx_frame_errors
++
;
if
(
status
&
XMR_FS_FCS_ERR
)
skge
->
net_stats
.
rx_crc_errors
++
;
}
else
{
if
(
status
&
(
GMR_FS_LONG_ERR
|
GMR_FS_UN_SIZE
))
skge
->
net_stats
.
rx_length_errors
++
;
if
(
status
&
GMR_FS_FRAGMENT
)
skge
->
net_stats
.
rx_frame_errors
++
;
if
(
status
&
GMR_FS_CRC_ERR
)
skge
->
net_stats
.
rx_crc_errors
++
;
}
}
/* Get receive buffer from descriptor.
/* Get receive buffer from descriptor.
* Handles copy of small buffers and reallocation failures
* Handles copy of small buffers and reallocation failures
*/
*/
static
inline
struct
sk_buff
*
skge_rx_get
(
struct
skge_port
*
skge
,
static
inline
struct
sk_buff
*
skge_rx_get
(
struct
skge_port
*
skge
,
struct
skge_element
*
e
,
struct
skge_element
*
e
,
u
nsigned
int
len
)
u
32
control
,
u32
status
,
u16
csum
)
{
{
struct
sk_buff
*
nskb
,
*
skb
;
struct
sk_buff
*
skb
;
u16
len
=
control
&
BMU_BBC
;
if
(
unlikely
(
netif_msg_rx_status
(
skge
)))
printk
(
KERN_DEBUG
PFX
"%s: rx slot %td status 0x%x len %d
\n
"
,
skge
->
netdev
->
name
,
e
-
skge
->
rx_ring
.
start
,
status
,
len
);
if
(
len
>
skge
->
rx_buf_size
)
goto
error
;
if
((
control
&
(
BMU_EOF
|
BMU_STF
))
!=
(
BMU_STF
|
BMU_EOF
))
goto
error
;
if
(
bad_phy_status
(
skge
->
hw
,
status
))
goto
error
;
if
(
phy_length
(
skge
->
hw
,
status
)
!=
len
)
goto
error
;
if
(
len
<
RX_COPY_THRESHOLD
)
{
if
(
len
<
RX_COPY_THRESHOLD
)
{
nskb
=
skge_rx_alloc
(
skge
->
netdev
,
len
+
NET_IP_ALIGN
);
skb
=
dev_alloc_skb
(
len
+
2
);
if
(
unlikely
(
!
nskb
)
)
if
(
!
skb
)
return
NULL
;
goto
resubmit
;
skb_reserve
(
skb
,
2
);
pci_dma_sync_single_for_cpu
(
skge
->
hw
->
pdev
,
pci_dma_sync_single_for_cpu
(
skge
->
hw
->
pdev
,
pci_unmap_addr
(
e
,
mapaddr
),
pci_unmap_addr
(
e
,
mapaddr
),
len
,
PCI_DMA_FROMDEVICE
);
len
,
PCI_DMA_FROMDEVICE
);
memcpy
(
n
skb
->
data
,
e
->
skb
->
data
,
len
);
memcpy
(
skb
->
data
,
e
->
skb
->
data
,
len
);
pci_dma_sync_single_for_device
(
skge
->
hw
->
pdev
,
pci_dma_sync_single_for_device
(
skge
->
hw
->
pdev
,
pci_unmap_addr
(
e
,
mapaddr
),
pci_unmap_addr
(
e
,
mapaddr
),
len
,
PCI_DMA_FROMDEVICE
);
len
,
PCI_DMA_FROMDEVICE
);
if
(
skge
->
rx_csum
)
{
struct
skge_rx_desc
*
rd
=
e
->
desc
;
nskb
->
csum
=
le16_to_cpu
(
rd
->
csum2
);
nskb
->
ip_summed
=
CHECKSUM_HW
;
}
skge_rx_reuse
(
e
,
skge
->
rx_buf_size
);
skge_rx_reuse
(
e
,
skge
->
rx_buf_size
);
return
nskb
;
}
else
{
}
else
{
nskb
=
skge_rx_alloc
(
skge
->
netdev
,
skge
->
rx_buf_size
);
struct
sk_buff
*
nskb
;
if
(
unlikely
(
!
nskb
))
nskb
=
dev_alloc_skb
(
skge
->
rx_buf_size
+
NET_IP_ALIGN
);
return
NULL
;
if
(
!
nskb
)
goto
resubmit
;
pci_unmap_single
(
skge
->
hw
->
pdev
,
pci_unmap_single
(
skge
->
hw
->
pdev
,
pci_unmap_addr
(
e
,
mapaddr
),
pci_unmap_addr
(
e
,
mapaddr
),
pci_unmap_len
(
e
,
maplen
),
pci_unmap_len
(
e
,
maplen
),
PCI_DMA_FROMDEVICE
);
PCI_DMA_FROMDEVICE
);
skb
=
e
->
skb
;
skb
=
e
->
skb
;
prefetch
(
skb
->
data
);
skge_rx_setup
(
skge
,
e
,
nskb
,
skge
->
rx_buf_size
);
}
skb_put
(
skb
,
len
);
skb
->
dev
=
skge
->
netdev
;
if
(
skge
->
rx_csum
)
{
if
(
skge
->
rx_csum
)
{
struct
skge_rx_desc
*
rd
=
e
->
desc
;
skb
->
csum
=
csum
;
skb
->
csum
=
le16_to_cpu
(
rd
->
csum2
);
skb
->
ip_summed
=
CHECKSUM_HW
;
skb
->
ip_summed
=
CHECKSUM_HW
;
}
}
skge_rx_setup
(
skge
,
e
,
nskb
,
skge
->
rx_buf_size
);
skb
->
protocol
=
eth_type_trans
(
skb
,
skge
->
netdev
);
return
skb
;
return
skb
;
error:
if
(
netif_msg_rx_err
(
skge
))
printk
(
KERN_DEBUG
PFX
"%s: rx err, slot %td control 0x%x status 0x%x
\n
"
,
skge
->
netdev
->
name
,
e
-
skge
->
rx_ring
.
start
,
control
,
status
);
if
(
skge
->
hw
->
chip_id
==
CHIP_ID_GENESIS
)
{
if
(
status
&
(
XMR_FS_RUNT
|
XMR_FS_LNG_ERR
))
skge
->
net_stats
.
rx_length_errors
++
;
if
(
status
&
XMR_FS_FRA_ERR
)
skge
->
net_stats
.
rx_frame_errors
++
;
if
(
status
&
XMR_FS_FCS_ERR
)
skge
->
net_stats
.
rx_crc_errors
++
;
}
else
{
if
(
status
&
(
GMR_FS_LONG_ERR
|
GMR_FS_UN_SIZE
))
skge
->
net_stats
.
rx_length_errors
++
;
if
(
status
&
GMR_FS_FRAGMENT
)
skge
->
net_stats
.
rx_frame_errors
++
;
if
(
status
&
GMR_FS_CRC_ERR
)
skge
->
net_stats
.
rx_crc_errors
++
;
}
}
resubmit:
skge_rx_reuse
(
e
,
skge
->
rx_buf_size
);
return
NULL
;
}
}
...
@@ -2541,32 +2545,16 @@ static int skge_poll(struct net_device *dev, int *budget)
...
@@ -2541,32 +2545,16 @@ static int skge_poll(struct net_device *dev, int *budget)
for
(
e
=
ring
->
to_clean
;
work_done
<
to_do
;
e
=
e
->
next
)
{
for
(
e
=
ring
->
to_clean
;
work_done
<
to_do
;
e
=
e
->
next
)
{
struct
skge_rx_desc
*
rd
=
e
->
desc
;
struct
skge_rx_desc
*
rd
=
e
->
desc
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
u32
control
,
len
,
status
;
u32
control
;
rmb
();
rmb
();
control
=
rd
->
control
;
control
=
rd
->
control
;
if
(
control
&
BMU_OWN
)
if
(
control
&
BMU_OWN
)
break
;
break
;
len
=
control
&
BMU_BBC
;
skb
=
skge_rx_get
(
skge
,
e
,
control
,
rd
->
status
,
status
=
rd
->
status
;
le16_to_cpu
(
rd
->
csum2
));
if
(
unlikely
((
control
&
(
BMU_EOF
|
BMU_STF
))
!=
(
BMU_STF
|
BMU_EOF
)
||
bad_phy_status
(
hw
,
status
)))
{
skge_rx_error
(
skge
,
e
-
ring
->
start
,
control
,
status
);
skge_rx_reuse
(
e
,
skge
->
rx_buf_size
);
continue
;
}
if
(
netif_msg_rx_status
(
skge
))
printk
(
KERN_DEBUG
PFX
"%s: rx slot %td status 0x%x len %d
\n
"
,
dev
->
name
,
e
-
ring
->
start
,
rd
->
status
,
len
);
skb
=
skge_rx_get
(
skge
,
e
,
len
);
if
(
likely
(
skb
))
{
if
(
likely
(
skb
))
{
skb_put
(
skb
,
len
);
skb
->
protocol
=
eth_type_trans
(
skb
,
dev
);
dev
->
last_rx
=
jiffies
;
dev
->
last_rx
=
jiffies
;
netif_receive_skb
(
skb
);
netif_receive_skb
(
skb
);
...
...
drivers/net/skge.h
View file @
da192bb5
...
@@ -953,6 +953,7 @@ enum {
...
@@ -953,6 +953,7 @@ enum {
*/
*/
enum
{
enum
{
XMR_FS_LEN
=
0x3fff
<<
18
,
/* Bit 31..18: Rx Frame Length */
XMR_FS_LEN
=
0x3fff
<<
18
,
/* Bit 31..18: Rx Frame Length */
XMR_FS_LEN_SHIFT
=
18
,
XMR_FS_2L_VLAN
=
1
<<
17
,
/* Bit 17: tagged wh 2Lev VLAN ID*/
XMR_FS_2L_VLAN
=
1
<<
17
,
/* Bit 17: tagged wh 2Lev VLAN ID*/
XMR_FS_1_VLAN
=
1
<<
16
,
/* Bit 16: tagged wh 1ev VLAN ID*/
XMR_FS_1_VLAN
=
1
<<
16
,
/* Bit 16: tagged wh 1ev VLAN ID*/
XMR_FS_BC
=
1
<<
15
,
/* Bit 15: Broadcast Frame */
XMR_FS_BC
=
1
<<
15
,
/* Bit 15: Broadcast Frame */
...
@@ -1868,6 +1869,7 @@ enum {
...
@@ -1868,6 +1869,7 @@ enum {
/* Receive Frame Status Encoding */
/* Receive Frame Status Encoding */
enum
{
enum
{
GMR_FS_LEN
=
0xffff
<<
16
,
/* Bit 31..16: Rx Frame Length */
GMR_FS_LEN
=
0xffff
<<
16
,
/* Bit 31..16: Rx Frame Length */
GMR_FS_LEN_SHIFT
=
16
,
GMR_FS_VLAN
=
1
<<
13
,
/* Bit 13: VLAN Packet */
GMR_FS_VLAN
=
1
<<
13
,
/* Bit 13: VLAN Packet */
GMR_FS_JABBER
=
1
<<
12
,
/* Bit 12: Jabber Packet */
GMR_FS_JABBER
=
1
<<
12
,
/* Bit 12: Jabber Packet */
GMR_FS_UN_SIZE
=
1
<<
11
,
/* Bit 11: Undersize Packet */
GMR_FS_UN_SIZE
=
1
<<
11
,
/* Bit 11: Undersize Packet */
...
...
drivers/pci/hotplug.c
View file @
da192bb5
...
@@ -7,7 +7,6 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
...
@@ -7,7 +7,6 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
char
*
buffer
,
int
buffer_size
)
char
*
buffer
,
int
buffer_size
)
{
{
struct
pci_dev
*
pdev
;
struct
pci_dev
*
pdev
;
char
*
scratch
;
int
i
=
0
;
int
i
=
0
;
int
length
=
0
;
int
length
=
0
;
...
@@ -18,9 +17,6 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
...
@@ -18,9 +17,6 @@ int pci_hotplug (struct device *dev, char **envp, int num_envp,
if
(
!
pdev
)
if
(
!
pdev
)
return
-
ENODEV
;
return
-
ENODEV
;
scratch
=
buffer
;
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
if
(
add_hotplug_env_var
(
envp
,
num_envp
,
&
i
,
buffer
,
buffer_size
,
&
length
,
buffer
,
buffer_size
,
&
length
,
"PCI_CLASS=%04X"
,
pdev
->
class
))
"PCI_CLASS=%04X"
,
pdev
->
class
))
...
...
drivers/pci/hotplug/rpadlpar_sysfs.c
View file @
da192bb5
...
@@ -62,7 +62,7 @@ static ssize_t add_slot_store(struct dlpar_io_attr *dlpar_attr,
...
@@ -62,7 +62,7 @@ static ssize_t add_slot_store(struct dlpar_io_attr *dlpar_attr,
char
drc_name
[
MAX_DRC_NAME_LEN
];
char
drc_name
[
MAX_DRC_NAME_LEN
];
char
*
end
;
char
*
end
;
if
(
nbytes
>
MAX_DRC_NAME_LEN
)
if
(
nbytes
>
=
MAX_DRC_NAME_LEN
)
return
0
;
return
0
;
memcpy
(
drc_name
,
buf
,
nbytes
);
memcpy
(
drc_name
,
buf
,
nbytes
);
...
@@ -83,7 +83,7 @@ static ssize_t remove_slot_store(struct dlpar_io_attr *dlpar_attr,
...
@@ -83,7 +83,7 @@ static ssize_t remove_slot_store(struct dlpar_io_attr *dlpar_attr,
char
drc_name
[
MAX_DRC_NAME_LEN
];
char
drc_name
[
MAX_DRC_NAME_LEN
];
char
*
end
;
char
*
end
;
if
(
nbytes
>
MAX_DRC_NAME_LEN
)
if
(
nbytes
>
=
MAX_DRC_NAME_LEN
)
return
0
;
return
0
;
memcpy
(
drc_name
,
buf
,
nbytes
);
memcpy
(
drc_name
,
buf
,
nbytes
);
...
...
drivers/pci/hotplug/sgi_hotplug.c
View file @
da192bb5
...
@@ -159,7 +159,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
...
@@ -159,7 +159,7 @@ static int sn_hp_slot_private_alloc(struct hotplug_slot *bss_hotplug_slot,
pcibus_info
=
SN_PCIBUS_BUSSOFT_INFO
(
pci_bus
);
pcibus_info
=
SN_PCIBUS_BUSSOFT_INFO
(
pci_bus
);
slot
=
k
calloc
(
1
,
sizeof
(
*
slot
),
GFP_KERNEL
);
slot
=
k
zalloc
(
sizeof
(
*
slot
),
GFP_KERNEL
);
if
(
!
slot
)
if
(
!
slot
)
return
-
ENOMEM
;
return
-
ENOMEM
;
bss_hotplug_slot
->
private
=
slot
;
bss_hotplug_slot
->
private
=
slot
;
...
@@ -491,7 +491,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
...
@@ -491,7 +491,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
if
(
sn_pci_slot_valid
(
pci_bus
,
device
)
!=
1
)
if
(
sn_pci_slot_valid
(
pci_bus
,
device
)
!=
1
)
continue
;
continue
;
bss_hotplug_slot
=
k
calloc
(
1
,
sizeof
(
*
bss_hotplug_slot
),
bss_hotplug_slot
=
k
zalloc
(
sizeof
(
*
bss_hotplug_slot
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
bss_hotplug_slot
)
{
if
(
!
bss_hotplug_slot
)
{
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
...
@@ -499,7 +499,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
...
@@ -499,7 +499,7 @@ static int sn_hotplug_slot_register(struct pci_bus *pci_bus)
}
}
bss_hotplug_slot
->
info
=
bss_hotplug_slot
->
info
=
k
calloc
(
1
,
sizeof
(
struct
hotplug_slot_info
),
k
zalloc
(
sizeof
(
struct
hotplug_slot_info
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
!
bss_hotplug_slot
->
info
)
{
if
(
!
bss_hotplug_slot
->
info
)
{
rc
=
-
ENOMEM
;
rc
=
-
ENOMEM
;
...
...
drivers/pci/pci-sysfs.c
View file @
da192bb5
...
@@ -360,7 +360,7 @@ pci_create_resource_files(struct pci_dev *pdev)
...
@@ -360,7 +360,7 @@ pci_create_resource_files(struct pci_dev *pdev)
continue
;
continue
;
/* allocate attribute structure, piggyback attribute name */
/* allocate attribute structure, piggyback attribute name */
res_attr
=
k
calloc
(
1
,
sizeof
(
*
res_attr
)
+
10
,
GFP_ATOMIC
);
res_attr
=
k
zalloc
(
sizeof
(
*
res_attr
)
+
10
,
GFP_ATOMIC
);
if
(
res_attr
)
{
if
(
res_attr
)
{
char
*
res_attr_name
=
(
char
*
)(
res_attr
+
1
);
char
*
res_attr_name
=
(
char
*
)(
res_attr
+
1
);
...
...
drivers/pci/probe.c
View file @
da192bb5
...
@@ -165,7 +165,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
...
@@ -165,7 +165,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
if
(
l
==
0xffffffff
)
if
(
l
==
0xffffffff
)
l
=
0
;
l
=
0
;
if
((
l
&
PCI_BASE_ADDRESS_SPACE
)
==
PCI_BASE_ADDRESS_SPACE_MEMORY
)
{
if
((
l
&
PCI_BASE_ADDRESS_SPACE
)
==
PCI_BASE_ADDRESS_SPACE_MEMORY
)
{
sz
=
pci_size
(
l
,
sz
,
PCI_BASE_ADDRESS_MEM_MASK
);
sz
=
pci_size
(
l
,
sz
,
(
u32
)
PCI_BASE_ADDRESS_MEM_MASK
);
if
(
!
sz
)
if
(
!
sz
)
continue
;
continue
;
res
->
start
=
l
&
PCI_BASE_ADDRESS_MEM_MASK
;
res
->
start
=
l
&
PCI_BASE_ADDRESS_MEM_MASK
;
...
@@ -215,7 +215,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
...
@@ -215,7 +215,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
if
(
l
==
0xffffffff
)
if
(
l
==
0xffffffff
)
l
=
0
;
l
=
0
;
if
(
sz
&&
sz
!=
0xffffffff
)
{
if
(
sz
&&
sz
!=
0xffffffff
)
{
sz
=
pci_size
(
l
,
sz
,
PCI_ROM_ADDRESS_MASK
);
sz
=
pci_size
(
l
,
sz
,
(
u32
)
PCI_ROM_ADDRESS_MASK
);
if
(
sz
)
{
if
(
sz
)
{
res
->
flags
=
(
l
&
IORESOURCE_ROM_ENABLE
)
|
res
->
flags
=
(
l
&
IORESOURCE_ROM_ENABLE
)
|
IORESOURCE_MEM
|
IORESOURCE_PREFETCH
|
IORESOURCE_MEM
|
IORESOURCE_PREFETCH
|
...
...
drivers/s390/cio/ccwgroup.c
View file @
da192bb5
...
@@ -437,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
...
@@ -437,7 +437,7 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
if
(
cdev
->
dev
.
driver_data
)
{
if
(
cdev
->
dev
.
driver_data
)
{
gdev
=
(
struct
ccwgroup_device
*
)
cdev
->
dev
.
driver_data
;
gdev
=
(
struct
ccwgroup_device
*
)
cdev
->
dev
.
driver_data
;
if
(
get_device
(
&
gdev
->
dev
))
{
if
(
get_device
(
&
gdev
->
dev
))
{
if
(
klist_node_attached
(
&
gdev
->
dev
.
knode_bus
))
if
(
device_is_registered
(
&
gdev
->
dev
))
return
gdev
;
return
gdev
;
put_device
(
&
gdev
->
dev
);
put_device
(
&
gdev
->
dev
);
}
}
...
...
drivers/usb/core/message.c
View file @
da192bb5
...
@@ -987,7 +987,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
...
@@ -987,7 +987,7 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
/* remove this interface if it has been registered */
/* remove this interface if it has been registered */
interface
=
dev
->
actconfig
->
interface
[
i
];
interface
=
dev
->
actconfig
->
interface
[
i
];
if
(
!
klist_node_attached
(
&
interface
->
dev
.
knode_bus
))
if
(
!
device_is_registered
(
&
interface
->
dev
))
continue
;
continue
;
dev_dbg
(
&
dev
->
dev
,
"unregistering interface %s
\n
"
,
dev_dbg
(
&
dev
->
dev
,
"unregistering interface %s
\n
"
,
interface
->
dev
.
bus_id
);
interface
->
dev
.
bus_id
);
...
...
drivers/usb/core/usb.c
View file @
da192bb5
...
@@ -303,7 +303,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,
...
@@ -303,7 +303,7 @@ int usb_driver_claim_interface(struct usb_driver *driver,
/* if interface was already added, bind now; else let
/* if interface was already added, bind now; else let
* the future device_add() bind it, bypassing probe()
* the future device_add() bind it, bypassing probe()
*/
*/
if
(
klist_node_attached
(
&
dev
->
knode_bus
))
if
(
device_is_registered
(
dev
))
device_bind_driver
(
dev
);
device_bind_driver
(
dev
);
return
0
;
return
0
;
...
@@ -336,8 +336,8 @@ void usb_driver_release_interface(struct usb_driver *driver,
...
@@ -336,8 +336,8 @@ void usb_driver_release_interface(struct usb_driver *driver,
if
(
iface
->
condition
!=
USB_INTERFACE_BOUND
)
if
(
iface
->
condition
!=
USB_INTERFACE_BOUND
)
return
;
return
;
/*
release only after device_add()
*/
/*
don't release if the interface hasn't been added yet
*/
if
(
klist_node_attached
(
&
dev
->
knode_bus
))
{
if
(
device_is_registered
(
dev
))
{
iface
->
condition
=
USB_INTERFACE_UNBINDING
;
iface
->
condition
=
USB_INTERFACE_UNBINDING
;
device_release_driver
(
dev
);
device_release_driver
(
dev
);
}
}
...
...
drivers/usb/gadget/pxa2xx_udc.c
View file @
da192bb5
...
@@ -422,7 +422,7 @@ static inline void ep0_idle (struct pxa2xx_udc *dev)
...
@@ -422,7 +422,7 @@ static inline void ep0_idle (struct pxa2xx_udc *dev)
}
}
static
int
static
int
write_packet
(
volatile
u
32
*
uddr
,
struct
pxa2xx_request
*
req
,
unsigned
max
)
write_packet
(
volatile
u
nsigned
long
*
uddr
,
struct
pxa2xx_request
*
req
,
unsigned
max
)
{
{
u8
*
buf
;
u8
*
buf
;
unsigned
length
,
count
;
unsigned
length
,
count
;
...
@@ -2602,7 +2602,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
...
@@ -2602,7 +2602,7 @@ static int __exit pxa2xx_udc_remove(struct device *_dev)
* VBUS IRQs should probably be ignored so that the PXA device just acts
* VBUS IRQs should probably be ignored so that the PXA device just acts
* "dead" to USB hosts until system resume.
* "dead" to USB hosts until system resume.
*/
*/
static
int
pxa2xx_udc_suspend
(
struct
device
*
dev
,
u32
state
,
u32
level
)
static
int
pxa2xx_udc_suspend
(
struct
device
*
dev
,
pm_message_t
state
,
u32
level
)
{
{
struct
pxa2xx_udc
*
udc
=
dev_get_drvdata
(
dev
);
struct
pxa2xx_udc
*
udc
=
dev_get_drvdata
(
dev
);
...
...
drivers/usb/gadget/pxa2xx_udc.h
View file @
da192bb5
...
@@ -69,11 +69,11 @@ struct pxa2xx_ep {
...
@@ -69,11 +69,11 @@ struct pxa2xx_ep {
* UDDR = UDC Endpoint Data Register (the fifo)
* UDDR = UDC Endpoint Data Register (the fifo)
* DRCM = DMA Request Channel Map
* DRCM = DMA Request Channel Map
*/
*/
volatile
u
32
*
reg_udccs
;
volatile
u
nsigned
long
*
reg_udccs
;
volatile
u
32
*
reg_ubcr
;
volatile
u
nsigned
long
*
reg_ubcr
;
volatile
u
32
*
reg_uddr
;
volatile
u
nsigned
long
*
reg_uddr
;
#ifdef USE_DMA
#ifdef USE_DMA
volatile
u
32
*
reg_drcmr
;
volatile
u
nsigned
long
*
reg_drcmr
;
#define drcmr(n) .reg_drcmr = & DRCMR ## n ,
#define drcmr(n) .reg_drcmr = & DRCMR ## n ,
#else
#else
#define drcmr(n)
#define drcmr(n)
...
...
drivers/usb/host/sl811-hcd.c
View file @
da192bb5
...
@@ -782,6 +782,9 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
...
@@ -782,6 +782,9 @@ static irqreturn_t sl811h_irq(struct usb_hcd *hcd, struct pt_regs *regs)
/* usb 1.1 says max 90% of a frame is available for periodic transfers.
/* usb 1.1 says max 90% of a frame is available for periodic transfers.
* this driver doesn't promise that much since it's got to handle an
* this driver doesn't promise that much since it's got to handle an
* IRQ per packet; irq handling latencies also use up that time.
* IRQ per packet; irq handling latencies also use up that time.
*
* NOTE: the periodic schedule is a sparse tree, with the load for
* each branch minimized. see fig 3.5 in the OHCI spec for example.
*/
*/
#define MAX_PERIODIC_LOAD 500
/* out of 1000 usec */
#define MAX_PERIODIC_LOAD 500
/* out of 1000 usec */
...
@@ -843,6 +846,7 @@ static int sl811h_urb_enqueue(
...
@@ -843,6 +846,7 @@ static int sl811h_urb_enqueue(
if
(
!
(
sl811
->
port1
&
(
1
<<
USB_PORT_FEAT_ENABLE
))
if
(
!
(
sl811
->
port1
&
(
1
<<
USB_PORT_FEAT_ENABLE
))
||
!
HC_IS_RUNNING
(
hcd
->
state
))
{
||
!
HC_IS_RUNNING
(
hcd
->
state
))
{
retval
=
-
ENODEV
;
retval
=
-
ENODEV
;
kfree
(
ep
);
goto
fail
;
goto
fail
;
}
}
...
@@ -911,8 +915,16 @@ static int sl811h_urb_enqueue(
...
@@ -911,8 +915,16 @@ static int sl811h_urb_enqueue(
case
PIPE_ISOCHRONOUS
:
case
PIPE_ISOCHRONOUS
:
case
PIPE_INTERRUPT
:
case
PIPE_INTERRUPT
:
urb
->
interval
=
ep
->
period
;
urb
->
interval
=
ep
->
period
;
if
(
ep
->
branch
<
PERIODIC_SIZE
)
if
(
ep
->
branch
<
PERIODIC_SIZE
)
{
/* NOTE: the phase is correct here, but the value
* needs offsetting by the transfer queue depth.
* All current drivers ignore start_frame, so this
* is unlikely to ever matter...
*/
urb
->
start_frame
=
(
sl811
->
frame
&
(
PERIODIC_SIZE
-
1
))
+
ep
->
branch
;
break
;
break
;
}
retval
=
balance
(
sl811
,
ep
->
period
,
ep
->
load
);
retval
=
balance
(
sl811
,
ep
->
period
,
ep
->
load
);
if
(
retval
<
0
)
if
(
retval
<
0
)
...
@@ -1122,7 +1134,7 @@ sl811h_hub_descriptor (
...
@@ -1122,7 +1134,7 @@ sl811h_hub_descriptor (
desc
->
wHubCharacteristics
=
(
__force
__u16
)
cpu_to_le16
(
temp
);
desc
->
wHubCharacteristics
=
(
__force
__u16
)
cpu_to_le16
(
temp
);
/* two bitmaps: ports removable, and legacy PortPwrCtrlMask */
/* two bitmaps: ports removable, and legacy PortPwrCtrlMask */
desc
->
bitmap
[
0
]
=
1
<<
1
;
desc
->
bitmap
[
0
]
=
0
<<
1
;
desc
->
bitmap
[
1
]
=
~
0
;
desc
->
bitmap
[
1
]
=
~
0
;
}
}
...
...
drivers/usb/net/pegasus.c
View file @
da192bb5
...
@@ -647,6 +647,13 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -647,6 +647,13 @@ static void read_bulk_callback(struct urb *urb, struct pt_regs *regs)
pkt_len
-=
8
;
pkt_len
-=
8
;
}
}
/*
* If the packet is unreasonably long, quietly drop it rather than
* kernel panicing by calling skb_put.
*/
if
(
pkt_len
>
PEGASUS_MTU
)
goto
goon
;
/*
/*
* at this point we are sure pegasus->rx_skb != NULL
* at this point we are sure pegasus->rx_skb != NULL
* so we go ahead and pass up the packet.
* so we go ahead and pass up the packet.
...
@@ -886,16 +893,18 @@ static inline void get_interrupt_interval(pegasus_t * pegasus)
...
@@ -886,16 +893,18 @@ static inline void get_interrupt_interval(pegasus_t * pegasus)
__u8
data
[
2
];
__u8
data
[
2
];
read_eprom_word
(
pegasus
,
4
,
(
__u16
*
)
data
);
read_eprom_word
(
pegasus
,
4
,
(
__u16
*
)
data
);
if
(
pegasus
->
usb
->
speed
!=
USB_SPEED_HIGH
)
{
if
(
data
[
1
]
<
0x80
)
{
if
(
data
[
1
]
<
0x80
)
{
if
(
netif_msg_timer
(
pegasus
))
if
(
netif_msg_timer
(
pegasus
))
dev_info
(
&
pegasus
->
intf
->
dev
,
dev_info
(
&
pegasus
->
intf
->
dev
,
"intr interval "
"intr interval
changed from %ums to %ums
\n
"
,
"
changed from %ums to %ums
\n
"
,
data
[
1
],
0x80
);
data
[
1
],
0x80
);
data
[
1
]
=
0x80
;
data
[
1
]
=
0x80
;
#ifdef PEGASUS_WRITE_EEPROM
#ifdef PEGASUS_WRITE_EEPROM
write_eprom_word
(
pegasus
,
4
,
*
(
__u16
*
)
data
);
write_eprom_word
(
pegasus
,
4
,
*
(
__u16
*
)
data
);
#endif
#endif
}
}
}
pegasus
->
intr_interval
=
data
[
1
];
pegasus
->
intr_interval
=
data
[
1
];
}
}
...
@@ -904,8 +913,9 @@ static void set_carrier(struct net_device *net)
...
@@ -904,8 +913,9 @@ static void set_carrier(struct net_device *net)
pegasus_t
*
pegasus
=
netdev_priv
(
net
);
pegasus_t
*
pegasus
=
netdev_priv
(
net
);
u16
tmp
;
u16
tmp
;
if
(
read_mii_word
(
pegasus
,
pegasus
->
phy
,
MII_BMSR
,
&
tmp
))
if
(
!
read_mii_word
(
pegasus
,
pegasus
->
phy
,
MII_BMSR
,
&
tmp
))
return
;
return
;
if
(
tmp
&
BMSR_LSTATUS
)
if
(
tmp
&
BMSR_LSTATUS
)
netif_carrier_on
(
net
);
netif_carrier_on
(
net
);
else
else
...
@@ -1355,6 +1365,7 @@ static void pegasus_disconnect(struct usb_interface *intf)
...
@@ -1355,6 +1365,7 @@ static void pegasus_disconnect(struct usb_interface *intf)
cancel_delayed_work
(
&
pegasus
->
carrier_check
);
cancel_delayed_work
(
&
pegasus
->
carrier_check
);
unregister_netdev
(
pegasus
->
net
);
unregister_netdev
(
pegasus
->
net
);
usb_put_dev
(
interface_to_usbdev
(
intf
));
usb_put_dev
(
interface_to_usbdev
(
intf
));
unlink_all_urbs
(
pegasus
);
free_all_urbs
(
pegasus
);
free_all_urbs
(
pegasus
);
free_skb_pool
(
pegasus
);
free_skb_pool
(
pegasus
);
if
(
pegasus
->
rx_skb
)
if
(
pegasus
->
rx_skb
)
...
...
drivers/usb/serial/airprime.c
View file @
da192bb5
...
@@ -16,7 +16,8 @@
...
@@ -16,7 +16,8 @@
#include "usb-serial.h"
#include "usb-serial.h"
static
struct
usb_device_id
id_table
[]
=
{
static
struct
usb_device_id
id_table
[]
=
{
{
USB_DEVICE
(
0xf3d
,
0x0112
)
},
{
USB_DEVICE
(
0xf3d
,
0x0112
)
},
/* AirPrime CDMA Wireless PC Card */
{
USB_DEVICE
(
0x1410
,
0x1110
)
},
/* Novatel Wireless Merlin CDMA */
{
},
{
},
};
};
MODULE_DEVICE_TABLE
(
usb
,
id_table
);
MODULE_DEVICE_TABLE
(
usb
,
id_table
);
...
...
drivers/usb/serial/ftdi_sio.c
View file @
da192bb5
...
@@ -1846,11 +1846,13 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
...
@@ -1846,11 +1846,13 @@ static void ftdi_set_termios (struct usb_serial_port *port, struct termios *old_
}
else
{
}
else
{
/* set the baudrate determined before */
/* set the baudrate determined before */
if
(
change_speed
(
port
))
{
if
(
change_speed
(
port
))
{
err
(
"%s urb failed to set bau
r
drate"
,
__FUNCTION__
);
err
(
"%s urb failed to set baudrate"
,
__FUNCTION__
);
}
}
/* Ensure RTS and DTR are raised */
/* Ensure RTS and DTR are raised when baudrate changed from 0 */
if
((
old_termios
->
c_cflag
&
CBAUD
)
==
B0
)
{
set_mctrl
(
port
,
TIOCM_DTR
|
TIOCM_RTS
);
set_mctrl
(
port
,
TIOCM_DTR
|
TIOCM_RTS
);
}
}
}
/* Set flow control */
/* Set flow control */
/* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
/* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
...
...
drivers/usb/serial/option.c
View file @
da192bb5
...
@@ -25,6 +25,9 @@
...
@@ -25,6 +25,9 @@
2005-06-20 v0.4.1 add missing braces :-/
2005-06-20 v0.4.1 add missing braces :-/
killed end-of-line whitespace
killed end-of-line whitespace
2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2
2005-07-15 v0.4.2 rename WLAN product to FUSION, add FUSION2
2005-09-10 v0.4.3 added HUAWEI E600 card and Audiovox AirCard
2005-09-20 v0.4.4 increased recv buffer size: the card sometimes
wants to send >2000 bytes.
Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
...
@@ -71,15 +74,21 @@ static int option_send_setup(struct usb_serial_port *port);
...
@@ -71,15 +74,21 @@ static int option_send_setup(struct usb_serial_port *port);
/* Vendor and product IDs */
/* Vendor and product IDs */
#define OPTION_VENDOR_ID 0x0AF0
#define OPTION_VENDOR_ID 0x0AF0
#define HUAWEI_VENDOR_ID 0x12D1
#define AUDIOVOX_VENDOR_ID 0x0F3D
#define OPTION_PRODUCT_OLD 0x5000
#define OPTION_PRODUCT_OLD 0x5000
#define OPTION_PRODUCT_FUSION 0x6000
#define OPTION_PRODUCT_FUSION 0x6000
#define OPTION_PRODUCT_FUSION2 0x6300
#define OPTION_PRODUCT_FUSION2 0x6300
#define HUAWEI_PRODUCT_E600 0x1001
#define AUDIOVOX_PRODUCT_AIRCARD 0x0112
static
struct
usb_device_id
option_ids
[]
=
{
static
struct
usb_device_id
option_ids
[]
=
{
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_OLD
)
},
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_OLD
)
},
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_FUSION
)
},
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_FUSION
)
},
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_FUSION2
)
},
{
USB_DEVICE
(
OPTION_VENDOR_ID
,
OPTION_PRODUCT_FUSION2
)
},
{
USB_DEVICE
(
HUAWEI_VENDOR_ID
,
HUAWEI_PRODUCT_E600
)
},
{
USB_DEVICE
(
AUDIOVOX_VENDOR_ID
,
AUDIOVOX_PRODUCT_AIRCARD
)
},
{
}
/* Terminating entry */
{
}
/* Terminating entry */
};
};
...
@@ -132,7 +141,7 @@ static int debug;
...
@@ -132,7 +141,7 @@ static int debug;
#define N_IN_URB 4
#define N_IN_URB 4
#define N_OUT_URB 1
#define N_OUT_URB 1
#define IN_BUFLEN
1024
#define IN_BUFLEN
4096
#define OUT_BUFLEN 128
#define OUT_BUFLEN 128
struct
option_port_private
{
struct
option_port_private
{
...
...
include/linux/device.h
View file @
da192bb5
...
@@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data)
...
@@ -317,6 +317,11 @@ dev_set_drvdata (struct device *dev, void *data)
dev
->
driver_data
=
data
;
dev
->
driver_data
=
data
;
}
}
static
inline
int
device_is_registered
(
struct
device
*
dev
)
{
return
klist_node_attached
(
&
dev
->
knode_bus
);
}
/*
/*
* High level routines for use by the bus drivers
* High level routines for use by the bus drivers
*/
*/
...
...
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