Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47645
b: refs/heads/master
c: 122952f
h: refs/heads/master
i:
  47643: bc41b22
v: v3
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Feb 11, 2007
1 parent 8963ff2 commit 436df8d
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 72 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9afa0949eea959f28248b717757c201765f1c19b
refs/heads/master: 122952fc2d6b5ca865e8475ec471d8944fa921c7
52 changes: 26 additions & 26 deletions trunk/net/8021q/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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.
*/
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand All @@ -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.
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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);

Expand All @@ -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.
Expand All @@ -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;
Expand All @@ -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;

Expand All @@ -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);
Expand Down Expand Up @@ -635,15 +635,15 @@ 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;

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++) {
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions trunk/net/8021q/vlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/

/*
Expand All @@ -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)


Expand All @@ -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);
Expand Down
Loading

0 comments on commit 436df8d

Please sign in to comment.