Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
c6428e52
Commit
c6428e52
authored
Jan 29, 2009
by
David Woodhouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
solos: Fix various bugs in status packet handling
Signed-off-by:
David Woodhouse
<
David.Woodhouse@intel.com
>
parent
a0641cc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
21 deletions
+28
-21
drivers/atm/solos-pci.c
drivers/atm/solos-pci.c
+28
-21
No files found.
drivers/atm/solos-pci.c
View file @
c6428e52
...
...
@@ -293,13 +293,15 @@ static char *next_string(struct sk_buff *skb)
{
int
i
=
0
;
char
*
this
=
skb
->
data
;
while
(
i
<
skb
->
len
)
{
for
(
i
=
0
;
i
<
skb
->
len
;
i
++
)
{
if
(
this
[
i
]
==
'\n'
)
{
this
[
i
]
=
0
;
skb_pull
(
skb
,
i
);
skb_pull
(
skb
,
i
+
1
);
return
this
;
}
if
(
!
isprint
(
this
[
i
]))
return
NULL
;
}
return
NULL
;
}
...
...
@@ -316,7 +318,7 @@ static char *next_string(struct sk_buff *skb)
static
int
process_status
(
struct
solos_card
*
card
,
int
port
,
struct
sk_buff
*
skb
)
{
char
*
str
,
*
end
,
*
state_str
;
int
ver
,
rate_up
,
rate_down
,
state
,
snr
,
attn
;
int
ver
,
rate_up
,
rate_down
,
state
;
if
(
!
card
->
atmdev
[
port
])
return
-
ENODEV
;
...
...
@@ -333,16 +335,22 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
}
str
=
next_string
(
skb
);
if
(
!
str
)
return
-
EIO
;
rate_up
=
simple_strtol
(
str
,
&
end
,
10
);
if
(
*
end
)
return
-
EIO
;
str
=
next_string
(
skb
);
if
(
!
str
)
return
-
EIO
;
rate_down
=
simple_strtol
(
str
,
&
end
,
10
);
if
(
*
end
)
return
-
EIO
;
state_str
=
next_string
(
skb
);
if
(
!
state_str
)
return
-
EIO
;
if
(
!
strcmp
(
state_str
,
"Showtime"
))
state
=
ATM_PHY_SIG_FOUND
;
else
{
...
...
@@ -350,25 +358,24 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
release_vccs
(
card
->
atmdev
[
port
]);
}
str
=
next_string
(
skb
);
snr
=
simple_strtol
(
str
,
&
end
,
10
);
if
(
*
end
)
return
-
EIO
;
str
=
next_string
(
skb
);
attn
=
simple_strtol
(
str
,
&
end
,
10
);
if
(
*
end
)
return
-
EIO
;
if
(
state
==
ATM_PHY_SIG_LOST
&&
!
rate_up
&&
!
rate_down
)
if
(
state
==
ATM_PHY_SIG_LOST
)
{
dev_info
(
&
card
->
dev
->
dev
,
"Port %d ATM state: %s
\n
"
,
port
,
state_str
);
else
dev_info
(
&
card
->
dev
->
dev
,
"Port %d ATM state: %s (%d/%d kb/s, SNR %ddB, Attn %ddB)
\n
"
,
port
,
state_str
,
rate_up
/
1000
,
rate_down
/
1000
,
snr
,
attn
);
card
->
atmdev
[
port
]
->
link_rate
=
rate_down
;
}
else
{
char
*
snr
,
*
attn
;
snr
=
next_string
(
skb
);
if
(
!
str
)
return
-
EIO
;
attn
=
next_string
(
skb
);
if
(
!
attn
)
return
-
EIO
;
dev_info
(
&
card
->
dev
->
dev
,
"Port %d: %s (%d/%d kb/s%s%s%s%s)
\n
"
,
port
,
state_str
,
rate_down
/
1000
,
rate_up
/
1000
,
snr
[
0
]
?
", SNR "
:
""
,
snr
,
attn
[
0
]
?
", Attn "
:
""
,
attn
);
}
card
->
atmdev
[
port
]
->
link_rate
=
rate_down
/
424
;
card
->
atmdev
[
port
]
->
signal
=
state
;
return
0
;
...
...
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