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
7a706ad1
Commit
7a706ad1
authored
22 years ago
by
Alan Cox
Committed by
David S. Miller
22 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VLAN: Fix gcc-3.1 warnings.
parent
42bdf87f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
45 deletions
+49
-45
net/8021q/vlan.c
net/8021q/vlan.c
+20
-20
net/8021q/vlan_dev.c
net/8021q/vlan_dev.c
+25
-21
net/8021q/vlanproc.c
net/8021q/vlanproc.c
+4
-4
No files found.
net/8021q/vlan.c
View file @
7a706ad1
...
@@ -91,9 +91,9 @@ static int __init vlan_proto_init(void)
...
@@ -91,9 +91,9 @@ static int __init vlan_proto_init(void)
/* proc file system initialization */
/* proc file system initialization */
err
=
vlan_proc_init
();
err
=
vlan_proc_init
();
if
(
err
<
0
)
{
if
(
err
<
0
)
{
printk
(
KERN_ERR
__FUNCTION__
printk
(
KERN_ERR
"%s: can't create entry in proc filesystem!
\n
"
,
"%s
%s
: can't create entry in proc filesystem!
\n
"
,
VLAN_NAME
);
__FUNCTION__
,
VLAN_NAME
);
return
1
;
return
1
;
}
}
...
@@ -203,7 +203,7 @@ static int unregister_vlan_dev(struct net_device *real_dev,
...
@@ -203,7 +203,7 @@ static int unregister_vlan_dev(struct net_device *real_dev,
int
i
,
ret
;
int
i
,
ret
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": VID: %i
\n
"
,
vlan_id
);
printk
(
VLAN_DBG
"%s: VID: %i
\n
"
,
__FUNCTION__
,
vlan_id
);
#endif
#endif
/* sanity check */
/* sanity check */
...
@@ -289,16 +289,16 @@ static int unregister_vlan_device(const char *vlan_IF_name)
...
@@ -289,16 +289,16 @@ static int unregister_vlan_device(const char *vlan_IF_name)
if
(
ret
==
1
)
if
(
ret
==
1
)
ret
=
0
;
ret
=
0
;
}
else
{
}
else
{
printk
(
VLAN_ERR
__FUNCTION__
printk
(
VLAN_ERR
": ERROR: Tried to remove a non-vlan device "
"
%s
: ERROR: Tried to remove a non-vlan device "
"with VLAN code, name: %s priv_flags: %hX
\n
"
,
"with VLAN code, name: %s priv_flags: %hX
\n
"
,
dev
->
name
,
dev
->
priv_flags
);
__FUNCTION__
,
dev
->
name
,
dev
->
priv_flags
);
dev_put
(
dev
);
dev_put
(
dev
);
ret
=
-
EPERM
;
ret
=
-
EPERM
;
}
}
}
else
{
}
else
{
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": WARNING: Could not find dev.
\n
"
);
printk
(
VLAN_DBG
"%s: WARNING: Could not find dev.
\n
"
,
__FUNCTION__
);
#endif
#endif
ret
=
-
EINVAL
;
ret
=
-
EINVAL
;
}
}
...
@@ -320,8 +320,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
...
@@ -320,8 +320,8 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
int
r
;
int
r
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
"
: if_name -:%s:- vid: %i
\n
"
,
printk
(
VLAN_DBG
"%s
: if_name -:%s:- vid: %i
\n
"
,
eth_IF_name
,
VLAN_ID
);
__FUNCTION__
,
eth_IF_name
,
VLAN_ID
);
#endif
#endif
if
(
VLAN_ID
>=
VLAN_VID_MASK
)
if
(
VLAN_ID
>=
VLAN_VID_MASK
)
...
@@ -333,24 +333,24 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
...
@@ -333,24 +333,24 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
goto
out_ret_null
;
goto
out_ret_null
;
if
(
real_dev
->
features
&
NETIF_F_VLAN_CHALLENGED
)
{
if
(
real_dev
->
features
&
NETIF_F_VLAN_CHALLENGED
)
{
printk
(
VLAN_DBG
__FUNCTION__
"
: VLANs not supported on %s.
\n
"
,
printk
(
VLAN_DBG
"%s
: VLANs not supported on %s.
\n
"
,
real_dev
->
name
);
__FUNCTION__
,
real_dev
->
name
);
goto
out_put_dev
;
goto
out_put_dev
;
}
}
if
((
real_dev
->
features
&
NETIF_F_HW_VLAN_RX
)
&&
if
((
real_dev
->
features
&
NETIF_F_HW_VLAN_RX
)
&&
(
real_dev
->
vlan_rx_register
==
NULL
||
(
real_dev
->
vlan_rx_register
==
NULL
||
real_dev
->
vlan_rx_kill_vid
==
NULL
))
{
real_dev
->
vlan_rx_kill_vid
==
NULL
))
{
printk
(
VLAN_DBG
__FUNCTION__
"
: Device %s has buggy VLAN hw accel.
\n
"
,
printk
(
VLAN_DBG
"%s
: Device %s has buggy VLAN hw accel.
\n
"
,
real_dev
->
name
);
__FUNCTION__
,
real_dev
->
name
);
goto
out_put_dev
;
goto
out_put_dev
;
}
}
if
((
real_dev
->
features
&
NETIF_F_HW_VLAN_FILTER
)
&&
if
((
real_dev
->
features
&
NETIF_F_HW_VLAN_FILTER
)
&&
(
real_dev
->
vlan_rx_add_vid
==
NULL
||
(
real_dev
->
vlan_rx_add_vid
==
NULL
||
real_dev
->
vlan_rx_kill_vid
==
NULL
))
{
real_dev
->
vlan_rx_kill_vid
==
NULL
))
{
printk
(
VLAN_DBG
__FUNCTION__
"
: Device %s has buggy VLAN hw accel.
\n
"
,
printk
(
VLAN_DBG
"%s
: Device %s has buggy VLAN hw accel.
\n
"
,
real_dev
->
name
);
__FUNCTION__
,
real_dev
->
name
);
goto
out_put_dev
;
goto
out_put_dev
;
}
}
...
@@ -371,7 +371,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
...
@@ -371,7 +371,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
if
(
r
)
{
if
(
r
)
{
/* was already registered. */
/* was already registered. */
printk
(
VLAN_DBG
__FUNCTION__
": ALREADY had VLAN registered
\n
"
);
printk
(
VLAN_DBG
"%s: ALREADY had VLAN registered
\n
"
,
__FUNCTION__
);
goto
out_unlock
;
goto
out_unlock
;
}
}
...
@@ -665,7 +665,7 @@ int vlan_ioctl_handler(unsigned long arg)
...
@@ -665,7 +665,7 @@ int vlan_ioctl_handler(unsigned long arg)
args
.
u
.
device2
[
23
]
=
0
;
args
.
u
.
device2
[
23
]
=
0
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": args.cmd: %x
\n
"
,
args
.
cmd
);
printk
(
VLAN_DBG
"%s: args.cmd: %x
\n
"
,
__FUNCTION__
,
args
.
cmd
);
#endif
#endif
switch
(
args
.
cmd
)
{
switch
(
args
.
cmd
)
{
...
@@ -728,8 +728,8 @@ int vlan_ioctl_handler(unsigned long arg)
...
@@ -728,8 +728,8 @@ int vlan_ioctl_handler(unsigned long arg)
default:
default:
/* pass on to underlying device instead?? */
/* pass on to underlying device instead?? */
printk
(
VLAN_DBG
__FUNCTION__
"
: Unknown VLAN CMD: %x
\n
"
,
printk
(
VLAN_DBG
"%s
: Unknown VLAN CMD: %x
\n
"
,
args
.
cmd
);
__FUNCTION__
,
args
.
cmd
);
return
-
EINVAL
;
return
-
EINVAL
;
};
};
...
...
This diff is collapsed.
Click to expand it.
net/8021q/vlan_dev.c
View file @
7a706ad1
...
@@ -125,8 +125,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
...
@@ -125,8 +125,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
vid
=
(
vlan_TCI
&
VLAN_VID_MASK
);
vid
=
(
vlan_TCI
&
VLAN_VID_MASK
);
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
"
: skb: %p vlan_id: %hx
\n
"
,
printk
(
VLAN_DBG
"%s
: skb: %p vlan_id: %hx
\n
"
,
skb
,
vid
);
__FUNCTION__
,
skb
,
vid
);
#endif
#endif
/* Ok, we will find the correct VLAN device, strip the header,
/* Ok, we will find the correct VLAN device, strip the header,
...
@@ -146,8 +146,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
...
@@ -146,8 +146,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
spin_unlock_bh
(
&
vlan_group_lock
);
spin_unlock_bh
(
&
vlan_group_lock
);
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": ERROR:
No net_device for VID: %i on dev: %s [%i]
\n
"
,
printk
(
VLAN_DBG
"%s: ERROR:
No net_device for VID: %i on dev: %s [%i]
\n
"
,
(
unsigned
int
)(
vid
),
dev
->
name
,
dev
->
ifindex
);
__FUNCTION__
,
(
unsigned
int
)(
vid
),
dev
->
name
,
dev
->
ifindex
);
#endif
#endif
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
...
@@ -170,8 +170,10 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
...
@@ -170,8 +170,10 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
spin_unlock_bh
(
&
vlan_group_lock
);
spin_unlock_bh
(
&
vlan_group_lock
);
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": dropping skb: %p because came in on wrong device, dev: %s real_dev: %s, skb_dev: %s
\n
"
,
printk
(
VLAN_DBG
"%s: dropping skb: %p because came in on wrong device, dev: %s real_dev: %s, skb_dev: %s
\n
"
,
skb
,
dev
->
name
,
VLAN_DEV_INFO
(
skb
->
dev
)
->
real_dev
->
name
,
skb
->
dev
->
name
);
__FUNCTION__
skb
,
dev
->
name
,
VLAN_DEV_INFO
(
skb
->
dev
)
->
real_dev
->
name
,
skb
->
dev
->
name
);
#endif
#endif
kfree_skb
(
skb
);
kfree_skb
(
skb
);
stats
->
rx_errors
++
;
stats
->
rx_errors
++
;
...
@@ -184,8 +186,9 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
...
@@ -184,8 +186,9 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
skb
->
priority
=
vlan_get_ingress_priority
(
skb
->
dev
,
ntohs
(
vhdr
->
h_vlan_TCI
));
skb
->
priority
=
vlan_get_ingress_priority
(
skb
->
dev
,
ntohs
(
vhdr
->
h_vlan_TCI
));
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": priority: %lu for TCI: %hu (hbo)
\n
"
,
printk
(
VLAN_DBG
"%s: priority: %lu for TCI: %hu (hbo)
\n
"
,
(
unsigned
long
)(
skb
->
priority
),
ntohs
(
vhdr
->
h_vlan_TCI
));
__FUNCTION__
,
(
unsigned
long
)(
skb
->
priority
),
ntohs
(
vhdr
->
h_vlan_TCI
));
#endif
#endif
/* The ethernet driver already did the pkt_type calculations
/* The ethernet driver already did the pkt_type calculations
...
@@ -331,8 +334,8 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
...
@@ -331,8 +334,8 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
struct
net_device
*
vdev
=
dev
;
/* save this for the bottom of the method */
struct
net_device
*
vdev
=
dev
;
/* save this for the bottom of the method */
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
"
: skb: %p type: %hx len: %x vlan_id: %hx, daddr: %p
\n
"
,
printk
(
VLAN_DBG
"%s
: skb: %p type: %hx len: %x vlan_id: %hx, daddr: %p
\n
"
,
skb
,
type
,
len
,
VLAN_DEV_INFO
(
dev
)
->
vlan_id
,
daddr
);
__FUNCTION__
,
skb
,
type
,
len
,
VLAN_DEV_INFO
(
dev
)
->
vlan_id
,
daddr
);
#endif
#endif
/* build vlan header only if re_order_header flag is NOT set. This
/* build vlan header only if re_order_header flag is NOT set. This
...
@@ -402,7 +405,7 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
...
@@ -402,7 +405,7 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
}
}
VLAN_DEV_INFO
(
vdev
)
->
cnt_inc_headroom_on_tx
++
;
VLAN_DEV_INFO
(
vdev
)
->
cnt_inc_headroom_on_tx
++
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
": %s: had to grow skb.
\n
"
,
vdev
->
name
);
printk
(
VLAN_DBG
"%s: %s: had to grow skb.
\n
"
,
__FUNCTION__
,
vdev
->
name
);
#endif
#endif
}
}
...
@@ -445,8 +448,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -445,8 +448,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
VLAN_DEV_INFO
(
dev
)
->
cnt_encap_on_xmit
++
;
VLAN_DEV_INFO
(
dev
)
->
cnt_encap_on_xmit
++
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
"
: proto to encap: 0x%hx (hbo)
\n
"
,
printk
(
VLAN_DBG
"%s
: proto to encap: 0x%hx (hbo)
\n
"
,
htons
(
veth
->
h_vlan_proto
));
__FUNCTION__
,
htons
(
veth
->
h_vlan_proto
));
#endif
#endif
if
(
skb_headroom
(
skb
)
<
VLAN_HLEN
)
{
if
(
skb_headroom
(
skb
)
<
VLAN_HLEN
)
{
...
@@ -489,8 +492,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
...
@@ -489,8 +492,8 @@ int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb
->
dev
=
VLAN_DEV_INFO
(
dev
)
->
real_dev
;
skb
->
dev
=
VLAN_DEV_INFO
(
dev
)
->
real_dev
;
#ifdef VLAN_DEBUG
#ifdef VLAN_DEBUG
printk
(
VLAN_DBG
__FUNCTION__
"
: about to send skb: %p to dev: %s
\n
"
,
printk
(
VLAN_DBG
"%s
: about to send skb: %p to dev: %s
\n
"
,
skb
,
skb
->
dev
->
name
);
__FUNCTION__
,
skb
,
skb
->
dev
->
name
);
printk
(
VLAN_DBG
" %2hx.%2hx.%2hx.%2xh.%2hx.%2hx %2hx.%2hx.%2hx.%2hx.%2hx.%2hx %4hx %4hx %4hx
\n
"
,
printk
(
VLAN_DBG
" %2hx.%2hx.%2hx.%2xh.%2hx.%2hx %2hx.%2hx.%2hx.%2hx.%2hx.%2hx %4hx %4hx %4hx
\n
"
,
veth
->
h_dest
[
0
],
veth
->
h_dest
[
1
],
veth
->
h_dest
[
2
],
veth
->
h_dest
[
3
],
veth
->
h_dest
[
4
],
veth
->
h_dest
[
5
],
veth
->
h_dest
[
0
],
veth
->
h_dest
[
1
],
veth
->
h_dest
[
2
],
veth
->
h_dest
[
3
],
veth
->
h_dest
[
4
],
veth
->
h_dest
[
5
],
veth
->
h_source
[
0
],
veth
->
h_source
[
1
],
veth
->
h_source
[
2
],
veth
->
h_source
[
3
],
veth
->
h_source
[
4
],
veth
->
h_source
[
5
],
veth
->
h_source
[
0
],
veth
->
h_source
[
1
],
veth
->
h_source
[
2
],
veth
->
h_source
[
3
],
veth
->
h_source
[
4
],
veth
->
h_source
[
5
],
...
@@ -609,19 +612,20 @@ int vlan_dev_set_vlan_flag(char *dev_name, __u32 flag, short flag_val)
...
@@ -609,19 +612,20 @@ int vlan_dev_set_vlan_flag(char *dev_name, __u32 flag, short flag_val)
dev_put
(
dev
);
dev_put
(
dev
);
return
0
;
return
0
;
}
else
{
}
else
{
printk
(
KERN_ERR
__FUNCTION__
"
: flag %i is not valid.
\n
"
,
printk
(
KERN_ERR
"%s
: flag %i is not valid.
\n
"
,
(
int
)(
flag
));
__FUNCTION__
,
(
int
)(
flag
));
dev_put
(
dev
);
dev_put
(
dev
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
}
else
{
}
else
{
printk
(
KERN_ERR
__FUNCTION__
printk
(
KERN_ERR
": %s is not a vlan device, priv_flags: %hX.
\n
"
,
"
%s
: %s is not a vlan device, priv_flags: %hX.
\n
"
,
dev
->
name
,
dev
->
priv_flags
);
__FUNCTION__
,
dev
->
name
,
dev
->
priv_flags
);
dev_put
(
dev
);
dev_put
(
dev
);
}
}
}
else
{
}
else
{
printk
(
KERN_ERR
__FUNCTION__
": Could not find device: %s
\n
"
,
dev_name
);
printk
(
KERN_ERR
"%s: Could not find device: %s
\n
"
,
__FUNCTION__
,
dev_name
);
}
}
return
-
EINVAL
;
return
-
EINVAL
;
...
...
This diff is collapsed.
Click to expand it.
net/8021q/vlanproc.c
View file @
7a706ad1
...
@@ -187,14 +187,14 @@ int vlan_proc_add_dev (struct net_device *vlandev)
...
@@ -187,14 +187,14 @@ int vlan_proc_add_dev (struct net_device *vlandev)
int
vlan_proc_rem_dev
(
struct
net_device
*
vlandev
)
int
vlan_proc_rem_dev
(
struct
net_device
*
vlandev
)
{
{
if
(
!
vlandev
)
{
if
(
!
vlandev
)
{
printk
(
VLAN_ERR
__FUNCTION__
"
: invalid argument: %p
\n
"
,
printk
(
VLAN_ERR
"%s
: invalid argument: %p
\n
"
,
vlandev
);
__FUNCTION__
,
vlandev
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
if
(
!
(
vlandev
->
priv_flags
&
IFF_802_1Q_VLAN
))
{
if
(
!
(
vlandev
->
priv_flags
&
IFF_802_1Q_VLAN
))
{
printk
(
VLAN_DBG
__FUNCTION__
"
: invalid argument, device: %s is not a VLAN device, priv_flags: 0x%4hX.
\n
"
,
printk
(
VLAN_DBG
"%s
: invalid argument, device: %s is not a VLAN device, priv_flags: 0x%4hX.
\n
"
,
vlandev
->
name
,
vlandev
->
priv_flags
);
__FUNCTION__
,
vlandev
->
name
,
vlandev
->
priv_flags
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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