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
02c3473c
Commit
02c3473c
authored
Jun 30, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o wl3501: use offsetof(struct wl3501_{rx,tx}_hdr, addr4) in more places
parent
42d6581e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
drivers/net/wireless/wl3501_cs.c
drivers/net/wireless/wl3501_cs.c
+23
-24
No files found.
drivers/net/wireless/wl3501_cs.c
View file @
02c3473c
...
...
@@ -898,6 +898,7 @@ static int wl3501_unblock_interrupt(struct wl3501_card *this)
*/
static
u16
wl3501_receive
(
struct
wl3501_card
*
this
,
u8
*
bf
,
u16
size
)
{
const
int
offset_addr4
=
offsetof
(
struct
wl3501_rx_hdr
,
addr4
);
u16
next_addr
,
next_addr1
;
u8
*
data
=
bf
+
12
;
...
...
@@ -914,10 +915,10 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size)
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
));
size
-=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
);
data
+=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
);
size
-=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
);
data
+=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
);
}
else
{
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
sizeof
(
struct
...
...
@@ -932,36 +933,31 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size)
data
+=
2
;
if
(
size
>
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
+
6
)
{
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
sizeof
(
struct
wl3501_rx_hdr
)
-
6
,
data
,
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
offset_addr4
,
data
,
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
+
6
);
size
=
size
-
(
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
))
+
6
;
data
+=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
+
6
;
size
-=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
+
6
;
data
+=
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
+
6
;
}
else
{
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
sizeof
(
struct
wl3501_rx_hdr
)
-
6
,
data
,
size
);
offset_addr4
,
data
,
size
);
size
=
0
;
}
}
}
else
{
if
(
size
>
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
-
6
)
{
if
(
size
>
WL3501_BLKSZ
-
offset_addr4
)
{
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
sizeof
(
struct
wl3501_rx_hdr
)
+
6
,
data
,
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
-
6
);
size
=
size
-
(
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
))
-
6
;
data
+=
(
WL3501_BLKSZ
-
sizeof
(
struct
wl3501_rx_hdr
)
-
6
);
data
,
WL3501_BLKSZ
-
offset_addr4
);
size
-=
WL3501_BLKSZ
-
offset_addr4
;
data
+=
WL3501_BLKSZ
-
offset_addr4
;
}
else
{
wl3501_get_from_wla
(
this
,
this
->
start_seg
+
sizeof
(
struct
wl3501_rx_hdr
)
+
6
,
...
...
@@ -973,8 +969,8 @@ static u16 wl3501_receive(struct wl3501_card *this, u8 *bf, u16 size)
if
(
size
>
WL3501_BLKSZ
-
5
)
{
wl3501_get_from_wla
(
this
,
next_addr
+
5
,
data
,
WL3501_BLKSZ
-
5
);
size
-=
(
WL3501_BLKSZ
-
5
)
;
data
+=
(
WL3501_BLKSZ
-
5
)
;
size
-=
WL3501_BLKSZ
-
5
;
data
+=
WL3501_BLKSZ
-
5
;
wl3501_get_from_wla
(
this
,
next_addr
+
2
,
&
next_addr1
,
sizeof
(
next_addr1
));
next_addr
=
next_addr1
;
...
...
@@ -2292,6 +2288,9 @@ static void wl3501_config(dev_link_t *link)
this
->
essid
[
2
]
=
'A'
;
this
->
essid
[
3
]
=
'N'
;
this
->
essid
[
4
]
=
'Y'
;
this
->
card_name
[
0
]
=
'\0'
;
this
->
firmware_date
[
0
]
=
'\0'
;
this
->
rssi
=
255
;
strlcpy
(
this
->
nick
,
"Planet WL3501"
,
sizeof
(
this
->
nick
));
spin_lock_init
(
&
this
->
lock
);
...
...
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