patch-2.4.19 linux-2.4.19/net/8021q/vlanproc.c
Next file: linux-2.4.19/net/Config.in
Previous file: linux-2.4.19/net/8021q/vlan_dev.c
Back to the patch index
Back to the overall index
- Lines: 102
- Date:
Fri Aug 2 17:39:46 2002
- Orig file:
linux-2.4.18/net/8021q/vlanproc.c
- Orig date:
Fri Dec 21 09:42:05 2001
diff -urN linux-2.4.18/net/8021q/vlanproc.c linux-2.4.19/net/8021q/vlanproc.c
@@ -273,7 +273,7 @@
{
struct net_device *vlandev = NULL;
struct vlan_group *grp = NULL;
- int i = 0;
+ int h, i;
char *nm_type = NULL;
struct vlan_dev_info *dev_info = NULL;
@@ -293,46 +293,34 @@
nm_type = "UNKNOWN";
}
- cnt += sprintf(buf + cnt, "Name-Type: %s bad_proto_recvd: %lu\n",
- nm_type, vlan_bad_proto_recvd);
+ cnt += sprintf(buf + cnt, "Name-Type: %s\n", nm_type);
- for (grp = p802_1Q_vlan_list; grp != NULL; grp = grp->next) {
- /* loop through all devices for this device */
-#ifdef VLAN_DEBUG
- printk(VLAN_DBG __FUNCTION__ ": found a group, addr: %p\n",grp);
-#endif
- for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
- vlandev = grp->vlan_devices[i];
- if (!vlandev)
- continue;
-#ifdef VLAN_DEBUG
- printk(VLAN_DBG __FUNCTION__
- ": found a vlan_dev, addr: %p\n", vlandev);
-#endif
- if ((cnt + 100) > VLAN_PROC_BUFSZ) {
- if ((cnt+strlen(term_msg)) < VLAN_PROC_BUFSZ)
- cnt += sprintf(buf+cnt, "%s", term_msg);
-
- return cnt;
- }
- if (!vlandev->priv) {
- printk(KERN_ERR __FUNCTION__
- ": ERROR: vlandev->priv is NULL\n");
- continue;
+ spin_lock_bh(&vlan_group_lock);
+ for (h = 0; h < VLAN_GRP_HASH_SIZE; h++) {
+ for (grp = vlan_group_hash[h]; grp != NULL; grp = grp->next) {
+ for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
+ vlandev = grp->vlan_devices[i];
+ if (!vlandev)
+ continue;
+
+ if ((cnt + 100) > VLAN_PROC_BUFSZ) {
+ if ((cnt+strlen(term_msg)) < VLAN_PROC_BUFSZ)
+ cnt += sprintf(buf+cnt, "%s", term_msg);
+
+ goto out;
+ }
+
+ dev_info = VLAN_DEV_INFO(vlandev);
+ cnt += sprintf(buf + cnt, "%-15s| %d | %s\n",
+ vlandev->name,
+ dev_info->vlan_id,
+ dev_info->real_dev->name);
}
-
- dev_info = VLAN_DEV_INFO(vlandev);
-
-#ifdef VLAN_DEBUG
- printk(VLAN_DBG __FUNCTION__
- ": got a good vlandev, addr: %p\n",
- VLAN_DEV_INFO(vlandev));
-#endif
- cnt += sprintf(buf + cnt, "%-15s| %d | %s\n",
- vlandev->name, dev_info->vlan_id,
- dev_info->real_dev->name);
}
}
+out:
+ spin_unlock_bh(&vlan_group_lock);
+
return cnt;
}
@@ -366,11 +354,7 @@
int cnt = 0;
int i;
-#ifdef VLAN_DEBUG
- printk(VLAN_DBG __FUNCTION__ ": vlandev: %p\n", vlandev);
-#endif
-
- if ((vlandev == NULL) || (!vlandev->priv_flags & IFF_802_1Q_VLAN))
+ if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
return 0;
dev_info = VLAN_DEV_INFO(vlandev);
@@ -427,7 +411,7 @@
cnt += sprintf(buf + cnt, "EGRESSS priority Mappings: ");
- for (i = 0; i<16; i++) {
+ for (i = 0; i < 16; i++) {
mp = dev_info->egress_priority_map[i];
while (mp) {
cnt += sprintf(buf + cnt, "%lu:%hu ",
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)