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
22a8591b
Commit
22a8591b
authored
Apr 04, 2003
by
Petko Manolov
Committed by
Greg Kroah-Hartman
Apr 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] USB: pegasus link status fix
fixed up the link status detection
parent
de37adec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
drivers/usb/net/pegasus.c
drivers/usb/net/pegasus.c
+8
-8
drivers/usb/net/pegasus.h
drivers/usb/net/pegasus.h
+2
-0
No files found.
drivers/usb/net/pegasus.c
View file @
22a8591b
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
/*
/*
* Version Information
* Version Information
*/
*/
#define DRIVER_VERSION "v0.5.
9 (2002/12/3
1)"
#define DRIVER_VERSION "v0.5.
10 (2003/04/0
1)"
#define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
#define DRIVER_AUTHOR "Petko Manolov <petkan@users.sourceforge.net>"
#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
#define DRIVER_DESC "Pegasus/Pegasus II USB Ethernet driver"
...
@@ -121,7 +121,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
...
@@ -121,7 +121,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char
*
buffer
;
char
*
buffer
;
DECLARE_WAITQUEUE
(
wait
,
current
);
DECLARE_WAITQUEUE
(
wait
,
current
);
buffer
=
kmalloc
(
size
,
GFP_
KERNEL
);
buffer
=
kmalloc
(
size
,
GFP_
DMA
);
if
(
!
buffer
)
{
if
(
!
buffer
)
{
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -170,7 +170,7 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
...
@@ -170,7 +170,7 @@ static int set_registers(pegasus_t * pegasus, __u16 indx, __u16 size,
char
*
buffer
;
char
*
buffer
;
DECLARE_WAITQUEUE
(
wait
,
current
);
DECLARE_WAITQUEUE
(
wait
,
current
);
buffer
=
kmalloc
(
size
,
GFP_
KERNEL
);
buffer
=
kmalloc
(
size
,
GFP_
DMA
);
if
(
!
buffer
)
{
if
(
!
buffer
)
{
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -218,7 +218,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
...
@@ -218,7 +218,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data)
char
*
tmp
;
char
*
tmp
;
DECLARE_WAITQUEUE
(
wait
,
current
);
DECLARE_WAITQUEUE
(
wait
,
current
);
tmp
=
kmalloc
(
1
,
GFP_
KERNEL
);
tmp
=
kmalloc
(
1
,
GFP_
DMA
);
if
(
!
tmp
)
{
if
(
!
tmp
)
{
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
warn
(
"%s: looks like we're out of memory"
,
__FUNCTION__
);
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -711,11 +711,11 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs)
...
@@ -711,11 +711,11 @@ static void intr_callback(struct urb *urb, struct pt_regs *regs)
pegasus
->
stats
.
tx_aborted_errors
++
;
pegasus
->
stats
.
tx_aborted_errors
++
;
if
(
d
[
0
]
&
LATE_COL
)
if
(
d
[
0
]
&
LATE_COL
)
pegasus
->
stats
.
tx_window_errors
++
;
pegasus
->
stats
.
tx_window_errors
++
;
if
(
d
[
0
]
&
(
NO_CARRIER
|
LOSS_CARRIER
))
{
if
(
d
[
5
]
&
LINK_STATUS
)
{
netif_carrier_on
(
net
);
}
else
{
pegasus
->
stats
.
tx_carrier_errors
++
;
pegasus
->
stats
.
tx_carrier_errors
++
;
netif_carrier_off
(
net
);
netif_carrier_off
(
net
);
}
else
{
netif_carrier_on
(
net
);
}
}
}
}
...
...
drivers/usb/net/pegasus.h
View file @
22a8591b
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
#define LOSS_CARRIER 0x08
#define LOSS_CARRIER 0x08
#define JABBER_TIMEOUT 0x04
#define JABBER_TIMEOUT 0x04
#define LINK_STATUS 0x01
#define PEGASUS_REQT_READ 0xc0
#define PEGASUS_REQT_READ 0xc0
#define PEGASUS_REQT_WRITE 0x40
#define PEGASUS_REQT_WRITE 0x40
#define PEGASUS_REQ_GET_REGS 0xf0
#define PEGASUS_REQ_GET_REGS 0xf0
...
...
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