Commit 122952fc authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller
Browse files

[NET] 8021Q: Fix whitespace errors.


Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9afa0949
......@@ -5,7 +5,7 @@
* Authors: Ben Greear <greearb@candelatech.com>
* Please send support related email to: vlan@scry.wanfear.com
* VLAN Home Page: http://www.candelatech.com/~greear/vlan.html
*
*
* Fixes:
* Fix for packet capture - Nick Eggleston <nick@dccinc.com>;
* Add HW acceleration hooks - David S. Miller <davem@redhat.com>;
......@@ -72,7 +72,7 @@ static struct packet_type vlan_packet_type = {
/*
* Function vlan_proto_init (pro)
*
* Initialize VLAN protocol layer,
* Initialize VLAN protocol layer,
*
*/
static int __init vlan_proto_init(void)
......@@ -87,7 +87,7 @@ static int __init vlan_proto_init(void)
/* proc file system initialization */
err = vlan_proc_init();
if (err < 0) {
printk(KERN_ERR
printk(KERN_ERR
"%s %s: can't create entry in proc filesystem!\n",
__FUNCTION__, VLAN_NAME);
return err;
......@@ -108,7 +108,7 @@ static int __init vlan_proto_init(void)
return 0;
}
/* Cleanup all vlan devices
/* Cleanup all vlan devices
* Note: devices that have been registered that but not
* brought up will exist but have no module ref count.
*/
......@@ -132,7 +132,7 @@ static void __exit vlan_cleanup_devices(void)
/*
* Module 'remove' entry point.
* o delete /proc/net/router directory and static entries.
*/
*/
static void __exit vlan_cleanup_module(void)
{
int i;
......@@ -184,7 +184,7 @@ struct net_device *__find_vlan_dev(struct net_device *real_dev,
struct vlan_group *grp = __vlan_find_group(real_dev->ifindex);
if (grp)
return grp->vlan_devices[VID];
return grp->vlan_devices[VID];
return NULL;
}
......@@ -269,7 +269,7 @@ static int unregister_vlan_dev(struct net_device *real_dev,
}
}
return ret;
return ret;
}
static int unregister_vlan_device(const char *vlan_IF_name)
......@@ -295,7 +295,7 @@ static int unregister_vlan_device(const char *vlan_IF_name)
if (ret == 1)
ret = 0;
} else {
printk(VLAN_ERR
printk(VLAN_ERR
"%s: ERROR: Tried to remove a non-vlan device "
"with VLAN code, name: %s priv_flags: %hX\n",
__FUNCTION__, dev->name, dev->priv_flags);
......@@ -315,7 +315,7 @@ static int unregister_vlan_device(const char *vlan_IF_name)
static void vlan_setup(struct net_device *new_dev)
{
SET_MODULE_OWNER(new_dev);
/* new_dev->ifindex = 0; it will be set when added to
* the global list.
* iflink is set as well.
......@@ -324,7 +324,7 @@ static void vlan_setup(struct net_device *new_dev)
/* Make this thing known as a VLAN device */
new_dev->priv_flags |= IFF_802_1Q_VLAN;
/* Set us up to have no queue, as the underlying Hardware device
* can do all the queueing we could want.
*/
......@@ -461,7 +461,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
default:
snprintf(name, IFNAMSIZ, "vlan%.4i", VLAN_ID);
};
new_dev = alloc_netdev(sizeof(struct vlan_dev_info), name,
vlan_setup);
......@@ -477,7 +477,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
new_dev->state = (real_dev->state & ((1<<__LINK_STATE_NOCARRIER) |
(1<<__LINK_STATE_DORMANT))) |
(1<<__LINK_STATE_PRESENT);
(1<<__LINK_STATE_PRESENT);
/* need 4 bytes for extra VLAN header info,
* hope the underlying device can handle it.
......@@ -496,7 +496,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
VLAN_MEM_DBG("new_dev->priv malloc, addr: %p size: %i\n",
new_dev->priv,
sizeof(struct vlan_dev_info));
memcpy(new_dev->broadcast, real_dev->broadcast, real_dev->addr_len);
memcpy(new_dev->dev_addr, real_dev->dev_addr, real_dev->addr_len);
new_dev->addr_len = real_dev->addr_len;
......@@ -521,7 +521,7 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
printk(VLAN_DBG "About to go find the group for idx: %i\n",
real_dev->ifindex);
#endif
if (register_netdevice(new_dev))
goto out_free_newdev;
......@@ -543,22 +543,22 @@ static struct net_device *register_vlan_device(const char *eth_IF_name,
grp = kzalloc(sizeof(struct vlan_group), GFP_KERNEL);
if (!grp)
goto out_free_unregister;
/* printk(KERN_ALERT "VLAN REGISTER: Allocated new group.\n"); */
grp->real_dev_ifindex = real_dev->ifindex;
hlist_add_head_rcu(&grp->hlist,
hlist_add_head_rcu(&grp->hlist,
&vlan_group_hash[vlan_grp_hashfn(real_dev->ifindex)]);
if (real_dev->features & NETIF_F_HW_VLAN_RX)
real_dev->vlan_rx_register(real_dev, grp);
}
grp->vlan_devices[VLAN_ID] = new_dev;
if (vlan_proc_add_dev(new_dev)<0)/* create it's proc entry */
printk(KERN_WARNING "VLAN: failed to add proc entry for %s\n",
new_dev->name);
printk(KERN_WARNING "VLAN: failed to add proc entry for %s\n",
new_dev->name);
if (real_dev->features & NETIF_F_HW_VLAN_FILTER)
real_dev->vlan_rx_add_vid(real_dev, VLAN_ID);
......@@ -635,7 +635,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
vlandev = grp->vlan_devices[i];
if (!vlandev)
continue;
flgs = vlandev->flags;
if (flgs & IFF_UP)
continue;
......@@ -643,7 +643,7 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event,
dev_change_flags(vlandev, flgs | IFF_UP);
}
break;
case NETDEV_UNREGISTER:
/* Delete all VLANs for this dev. */
for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
......@@ -755,8 +755,8 @@ static int vlan_ioctl_handler(void __user *arg)
/* TODO: Implement
err = vlan_dev_get_ingress_priority(args);
if (copy_to_user((void*)arg, &args,
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
}
*/
err = -EINVAL;
......@@ -765,8 +765,8 @@ static int vlan_ioctl_handler(void __user *arg)
/* TODO: Implement
err = vlan_dev_get_egress_priority(args.device1, &(args.args);
if (copy_to_user((void*)arg, &args,
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
}
*/
err = -EINVAL;
......@@ -788,7 +788,7 @@ static int vlan_ioctl_handler(void __user *arg)
args.u.VID = vid;
if (copy_to_user(arg, &args,
sizeof(struct vlan_ioctl_args))) {
err = -EFAULT;
err = -EFAULT;
}
break;
......
......@@ -9,8 +9,8 @@
#define VLAN_ERR KERN_ERR
#define VLAN_INF KERN_INFO
#define VLAN_DBG KERN_ALERT /* change these... to debug, having a hard time
* changing the log level at run-time..for some reason.
*/
* changing the log level at run-time..for some reason.
*/
/*
......@@ -24,7 +24,7 @@ I'll bet they might prove useful again... --Ben
*/
/* This way they don't do anything! */
#define VLAN_MEM_DBG(x, y, z)
#define VLAN_MEM_DBG(x, y, z)
#define VLAN_FMEM_DBG(x, y)
......@@ -51,10 +51,10 @@ struct net_device *__find_vlan_dev(struct net_device* real_dev,
/* found in vlan_dev.c */
int vlan_dev_rebuild_header(struct sk_buff *skb);
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *ptype, struct net_device *orig_dev);
struct packet_type *ptype, struct net_device *orig_dev);
int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr,
unsigned len);
unsigned short type, void *daddr, void *saddr,
unsigned len);
int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
int vlan_dev_hwaccel_hard_start_xmit(struct sk_buff *skb, struct net_device *dev);
int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);
......
......@@ -5,14 +5,14 @@
* Authors: Ben Greear <greearb@candelatech.com>
* Please send support related email to: vlan@scry.wanfear.com
* VLAN Home Page: http://www.candelatech.com/~greear/vlan.html
*
*
* Fixes: Mar 22 2001: Martin Bokaemper <mbokaemper@unispherenetworks.com>
* - reset skb->pkt_type on incoming packets when MAC was changed
* - see that changed MAC is saddr for outgoing packets
* Oct 20, 2001: Ard van Breeman:
* - Fix MC-list, finally.
* - Flush MC-list on VLAN destroy.
*
*
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -58,12 +58,12 @@ int vlan_dev_rebuild_header(struct sk_buff *skb)
/* TODO: Confirm this will work with VLAN headers... */
return arp_find(veth->h_dest, skb);
#endif
#endif
default:
printk(VLAN_DBG
"%s: unable to resolve type %X addresses.\n",
"%s: unable to resolve type %X addresses.\n",
dev->name, ntohs(veth->h_vlan_encapsulated_proto));
memcpy(veth->h_source, dev->dev_addr, ETH_ALEN);
break;
};
......@@ -91,7 +91,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
}
/*
* Determine the packet's protocol ID. The rule here is that we
* Determine the packet's protocol ID. The rule here is that we
* assume 802.3 if the type field is short enough to be a length.
* This is normal practice and works for any 'now in use' protocol.
*
......@@ -113,7 +113,7 @@ static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
*
*/
int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
struct packet_type* ptype, struct net_device *orig_dev)
struct packet_type* ptype, struct net_device *orig_dev)
{
unsigned char *rawp = NULL;
struct vlan_hdr *vhdr = (struct vlan_hdr *)(skb->data);
......@@ -175,8 +175,8 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
#ifdef VLAN_DEBUG
printk(VLAN_DBG "%s: dropping skb: %p because came in on wrong device, dev: %s real_dev: %s, skb_dev: %s\n",
__FUNCTION__, skb, dev->name,
VLAN_DEV_INFO(skb->dev)->real_dev->name,
__FUNCTION__, skb, dev->name,
VLAN_DEV_INFO(skb->dev)->real_dev->name,
skb->dev->name);
#endif
kfree_skb(skb);
......@@ -191,7 +191,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
#ifdef VLAN_DEBUG
printk(VLAN_DBG "%s: priority: %lu for TCI: %hu (hbo)\n",
__FUNCTION__, (unsigned long)(skb->priority),
__FUNCTION__, (unsigned long)(skb->priority),
ntohs(vhdr->h_vlan_TCI));
#endif
......@@ -207,7 +207,7 @@ int vlan_skb_recv(struct sk_buff *skb, struct net_device *dev,
stats->multicast++;
break;
case PACKET_OTHERHOST:
case PACKET_OTHERHOST:
/* Our lower layer thinks this is not local, let's make sure.
* This allows the VLAN to have a different MAC than the underlying
* device, and still route correctly.
......@@ -319,7 +319,7 @@ static inline unsigned short vlan_dev_get_egress_qos_mask(struct net_device* dev
}
/*
* Create the VLAN header for an arbitrary protocol layer
* Create the VLAN header for an arbitrary protocol layer
*
* saddr=NULL means use device source address
* daddr=NULL means leave destination address (eg unresolved arp)
......@@ -328,8 +328,8 @@ static inline unsigned short vlan_dev_get_egress_qos_mask(struct net_device* dev
* physical devices.
*/
int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, void *daddr, void *saddr,
unsigned len)
unsigned short type, void *daddr, void *saddr,
unsigned len)
{
struct vlan_hdr *vhdr;
unsigned short veth_TCI = 0;
......@@ -346,7 +346,7 @@ int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
* fixes some programs that get confused when they see a VLAN device
* sending a frame that is VLAN encoded (the consensus is that the VLAN
* device should look completely like an Ethernet device when the
* REORDER_HEADER flag is set) The drawback to this is some extra
* REORDER_HEADER flag is set) The drawback to this is some extra
* header shuffling in the hard_start_xmit. Users can turn off this
* REORDER behaviour with the vconfig tool.
*/
......@@ -553,7 +553,7 @@ int vlan_dev_set_egress_priority(char *dev_name, __u32 skb_prio, short vlan_prio
struct net_device *dev = dev_get_by_name(dev_name);
struct vlan_priority_tci_mapping *mp = NULL;
struct vlan_priority_tci_mapping *np;
if (dev) {
if (dev->priv_flags & IFF_802_1Q_VLAN) {
/* See if a priority mapping exists.. */
......@@ -610,13 +610,13 @@ int vlan_dev_set_vlan_flag(char *dev_name, __u32 flag, short flag_val)
return -EINVAL;
}
} else {
printk(KERN_ERR
printk(KERN_ERR
"%s: %s is not a vlan device, priv_flags: %hX.\n",
__FUNCTION__, dev->name, dev->priv_flags);
dev_put(dev);
}
} else {
printk(KERN_ERR "%s: Could not find device: %s\n",
printk(KERN_ERR "%s: Could not find device: %s\n",
__FUNCTION__, dev_name);
}
......@@ -700,7 +700,7 @@ int vlan_dev_set_mac_address(struct net_device *dev, void *addr_struct_p)
}
static inline int vlan_dmi_equals(struct dev_mc_list *dmi1,
struct dev_mc_list *dmi2)
struct dev_mc_list *dmi2)
{
return ((dmi1->dmi_addrlen == dmi2->dmi_addrlen) &&
(memcmp(dmi1->dmi_addr, dmi2->dmi_addr, dmi1->dmi_addrlen) == 0));
......@@ -810,7 +810,7 @@ int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:
if (real_dev->do_ioctl && netif_device_present(real_dev))
if (real_dev->do_ioctl && netif_device_present(real_dev))
err = real_dev->do_ioctl(real_dev, &ifrr, cmd);
break;
......@@ -818,7 +818,7 @@ int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
err = dev_ethtool(&ifrr);
}
if (!err)
if (!err)
ifr->ifr_ifru = ifrr.ifr_ifru;
return err;
......
......@@ -51,7 +51,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *v);
/*
* Names of the proc directory entries
* Names of the proc directory entries
*/
static const char name_root[] = "vlan";
......@@ -66,7 +66,7 @@ static const char name_conf[] = "config";
*/
/*
* Generic /proc/net/vlan/<file> file and inode operations
* Generic /proc/net/vlan/<file> file and inode operations
*/
static struct seq_operations vlan_seq_ops = {
......@@ -111,13 +111,13 @@ static struct file_operations vlandev_fops = {
*/
/*
* /proc/net/vlan
* /proc/net/vlan
*/
static struct proc_dir_entry *proc_vlan_dir;
/*
* /proc/net/vlan/config
* /proc/net/vlan/config
*/
static struct proc_dir_entry *proc_vlan_conf;
......@@ -238,15 +238,15 @@ int vlan_proc_rem_dev(struct net_device *vlandev)
*/
/* starting at dev, find a VLAN device */
static struct net_device *vlan_skip(struct net_device *dev)
static struct net_device *vlan_skip(struct net_device *dev)
{
while (dev && !(dev->priv_flags & IFF_802_1Q_VLAN))
while (dev && !(dev->priv_flags & IFF_802_1Q_VLAN))
dev = dev->next;
return dev;
}
/* start read of /proc/net/vlan/config */
/* start read of /proc/net/vlan/config */
static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
{
struct net_device *dev;
......@@ -256,19 +256,19 @@ static void *vlan_seq_start(struct seq_file *seq, loff_t *pos)
if (*pos == 0)
return SEQ_START_TOKEN;
for (dev = vlan_skip(dev_base); dev && i < *pos;
for (dev = vlan_skip(dev_base); dev && i < *pos;
dev = vlan_skip(dev->next), ++i);
return (i == *pos) ? dev : NULL;
}
}
static void *vlan_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
++*pos;
return vlan_skip((v == SEQ_START_TOKEN)
? dev_base
return vlan_skip((v == SEQ_START_TOKEN)
? dev_base
: ((struct net_device *)v)->next);
}
......@@ -287,13 +287,13 @@ static int vlan_seq_show(struct seq_file *seq, void *v)
if (vlan_name_type < ARRAY_SIZE(vlan_name_type_str))
nmtype = vlan_name_type_str[vlan_name_type];
seq_printf(seq, "Name-Type: %s\n",
seq_printf(seq, "Name-Type: %s\n",
nmtype ? nmtype : "UNKNOWN" );
} else {
const struct net_device *vlandev = v;
const struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
seq_printf(seq, "%-15s| %d | %s\n", vlandev->name,
seq_printf(seq, "%-15s| %d | %s\n", vlandev->name,
dev_info->vlan_id, dev_info->real_dev->name);
}
return 0;
......@@ -323,13 +323,13 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
seq_puts(seq, "\n");
seq_printf(seq, fmt, "total frames transmitted", stats->tx_packets);
seq_printf(seq, fmt, "total bytes transmitted", stats->tx_bytes);
seq_printf(seq, fmt, "total headroom inc",
seq_printf(seq, fmt, "total headroom inc",
dev_info->cnt_inc_headroom_on_tx);
seq_printf(seq, fmt, "total encap on xmit",
seq_printf(seq, fmt, "total encap on xmit",
dev_info->cnt_encap_on_xmit);
seq_printf(seq, "Device: %s", dev_info->real_dev->name);
/* now show all PRIORITY mappings relating to this VLAN */
seq_printf(seq,
seq_printf(seq,
"\nINGRESS priority mappings: 0:%lu 1:%lu 2:%lu 3:%lu 4:%lu 5:%lu 6:%lu 7:%lu\n",
dev_info->ingress_priority_map[0],
dev_info->ingress_priority_map[1],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment