For Devicescape, "norm" means "AP". It is understandable as their devices operate normally in an AP mode. This is not the case of Linux in general, so rename "norm" to "ap". Signed-off-by: Jiri Benc Index: netdev/net/ieee80211/ieee80211_i.h =================================================================== --- netdev.orig/net/ieee80211/ieee80211_i.h 2006-01-06 16:55:39.000000000 +0100 +++ netdev/net/ieee80211/ieee80211_i.h 2006-01-06 16:55:42.000000000 +0100 @@ -171,7 +171,7 @@ typedef ieee80211_txrx_result (*ieee8021 typedef ieee80211_txrx_result (*ieee80211_rx_handler) (struct ieee80211_txrx_data *rx); -struct ieee80211_if_norm { +struct ieee80211_if_ap { u8 *beacon_head, *beacon_tail; int beacon_head_len, beacon_tail_len; @@ -249,7 +249,7 @@ struct ieee80211_if_sta { }; -#define IEEE80211_SUB_IF_TYPE_NORM 0x00000000 +#define IEEE80211_SUB_IF_TYPE_AP 0x00000000 #define IEEE80211_SUB_IF_TYPE_MGMT 0x00000001 #define IEEE80211_SUB_IF_TYPE_STA 0x00000002 #define IEEE80211_SUB_IF_TYPE_WDS 0x5A580211 @@ -275,10 +275,10 @@ struct ieee80211_sub_if_data { struct ieee80211_key *keys[NUM_DEFAULT_KEYS]; struct ieee80211_key *default_key; - struct ieee80211_if_norm *bss; /* BSS that this device belongs to */ + struct ieee80211_if_ap *bss; /* BSS that this device belongs to */ union { - struct ieee80211_if_norm norm; + struct ieee80211_if_ap ap; struct ieee80211_if_wds wds; struct ieee80211_if_vlan vlan; struct ieee80211_if_sta sta; @@ -366,7 +366,7 @@ struct ieee80211_local { spinlock_t sub_if_lock; /* mutex for STA data structures */ struct list_head sub_if_list; - struct net_device **bss_devs; /* pointer to IF_TYPE_NORM devices for + struct net_device **bss_devs; /* pointer to IF_TYPE_AP devices for * quick access to BSS data */ int bss_dev_count; /* number of used entries in bss_devs; note: the * total size of bss_devs array is stored in @@ -498,12 +498,12 @@ int ieee80211_if_add_wds(struct net_devi struct ieee80211_if_wds *wds, int locked); int ieee80211_if_add_vlan(struct net_device *dev, char *name, struct ieee80211_if_vlan *vlan, int locked); -int ieee80211_if_add_norm(struct net_device *dev, char *name, u8 *bssid, - int locked); +int ieee80211_if_add_ap(struct net_device *dev, char *name, u8 *bssid, + int locked); int ieee80211_if_remove_wds(struct net_device *dev, char *name, int locked); int ieee80211_if_remove_vlan(struct net_device *dev, char *name, int locked); -int ieee80211_if_remove_norm(struct net_device *dev, char *name, int locked); +int ieee80211_if_remove_ap(struct net_device *dev, char *name, int locked); int ieee80211_if_flush(struct net_device *dev, int locked); int ieee80211_if_update_wds(struct net_device *dev, char *name, struct ieee80211_if_wds *wds, int locked); Index: netdev/net/ieee80211/ieee80211.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211.c 2006-01-06 16:55:39.000000000 +0100 +++ netdev/net/ieee80211/ieee80211.c 2006-01-06 17:05:10.000000000 +0100 @@ -920,19 +920,19 @@ static void purge_old_ps_buffers(struct spin_lock_bh(&local->sub_if_lock); list_for_each(ptr, &local->sub_if_list) { - struct ieee80211_if_norm *norm; + struct ieee80211_if_ap *ap; struct ieee80211_sub_if_data *sdata = list_entry(ptr, struct ieee80211_sub_if_data, list); if (sdata->dev == local->mdev || - sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + sdata->type != IEEE80211_SUB_IF_TYPE_AP) continue; - norm = &sdata->u.norm; - skb = skb_dequeue(&norm->ps_bc_buf); + ap = &sdata->u.ap; + skb = skb_dequeue(&ap->ps_bc_buf); if (skb) { purged++; dev_kfree_skb(skb); } - total += skb_queue_len(&norm->ps_bc_buf); + total += skb_queue_len(&ap->ps_bc_buf); } spin_unlock_bh(&local->sub_if_lock); @@ -1281,7 +1281,7 @@ static int ieee80211_subif_start_xmit(st /* TODO: handling for 802.1x authorized/unauthorized port */ fc = (WLAN_FC_TYPE_DATA << 2) | (WLAN_FC_STYPE_DATA << 4); - if (likely(sdata->type == IEEE80211_SUB_IF_TYPE_NORM || + if (likely(sdata->type == IEEE80211_SUB_IF_TYPE_AP || sdata->type == IEEE80211_SUB_IF_TYPE_VLAN)) { if (local->conf.mode == IW_MODE_MASTER) { fc |= WLAN_FC_FROMDS; @@ -1498,7 +1498,7 @@ ieee80211_mgmt_start_xmit(struct sk_buff static void ieee80211_beacon_add_tim(struct ieee80211_local *local, - struct ieee80211_if_norm *bss, + struct ieee80211_if_ap *bss, struct sk_buff *skb) { u8 *pos, *tim; @@ -1580,7 +1580,7 @@ struct sk_buff * ieee80211_beacon_get(st struct sk_buff *skb; struct net_device *bdev; struct ieee80211_sub_if_data *sdata = NULL; - struct ieee80211_if_norm *norm = NULL; + struct ieee80211_if_ap *ap = NULL; struct ieee80211_rate *rate; struct rate_control_extra extra; u8 *b_head, *b_tail; @@ -1593,11 +1593,11 @@ struct sk_buff * ieee80211_beacon_get(st else { bdev = local->bss_devs[bss_idx]; sdata = IEEE80211_DEV_TO_SUB_IF(bdev); - norm = &sdata->u.norm; + ap = &sdata->u.ap; } spin_unlock_bh(&local->sub_if_lock); - if (bdev == NULL || norm == NULL || norm->beacon_head == NULL) { + if (bdev == NULL || ap == NULL || ap->beacon_head == NULL) { #ifdef CONFIG_IEEE80211_VERBOSE_DEBUG if (net_ratelimit()) printk(KERN_DEBUG "no beacon data avail for idx=%d " @@ -1607,10 +1607,10 @@ struct sk_buff * ieee80211_beacon_get(st } /* Assume we are generating the normal beacon locally */ - b_head = norm->beacon_head; - b_tail = norm->beacon_tail; - bh_len = norm->beacon_head_len; - bt_len = norm->beacon_tail_len; + b_head = ap->beacon_head; + b_tail = ap->beacon_tail; + bh_len = ap->beacon_head_len; + bt_len = ap->beacon_tail_len; skb = dev_alloc_skb(bh_len + bt_len + 256 /* maximum TIM len */); @@ -1619,7 +1619,7 @@ struct sk_buff * ieee80211_beacon_get(st memcpy(skb_put(skb, bh_len), b_head, bh_len); - ieee80211_beacon_add_tim(local, norm, skb); + ieee80211_beacon_add_tim(local, ap, skb); if (b_tail) { memcpy(skb_put(skb, bt_len), b_tail, bt_len); @@ -1650,7 +1650,7 @@ struct sk_buff * ieee80211_beacon_get(st control->clear_dst_mask = 1; - norm->num_beacons++; + ap->num_beacons++; return skb; } @@ -1666,7 +1666,7 @@ ieee80211_get_buffered_bc(struct net_dev ieee80211_txrx_result res = TXRX_DROP; struct net_device *bdev; struct ieee80211_sub_if_data *sdata; - struct ieee80211_if_norm *bss; + struct ieee80211_if_ap *bss; spin_lock_bh(&local->sub_if_lock); @@ -1676,7 +1676,7 @@ ieee80211_get_buffered_bc(struct net_dev } else { bdev = local->bss_devs[bss_idx]; sdata = IEEE80211_DEV_TO_SUB_IF(bdev); - bss = &sdata->u.norm; + bss = &sdata->u.ap; } spin_unlock_bh(&local->sub_if_lock); if (bdev == NULL || bss == NULL || bss->beacon_head == NULL) @@ -3887,14 +3887,14 @@ static struct net_device *ieee80211_if_a wds_dev->tx_queue_len = 0; sdata = IEEE80211_DEV_TO_SUB_IF(wds_dev); - sdata->type = IEEE80211_SUB_IF_TYPE_NORM; + sdata->type = IEEE80211_SUB_IF_TYPE_AP; sdata->master = local->mdev; sdata->dev = wds_dev; sdata->local = local; memset(&sdata->stats, 0, sizeof(struct net_device_stats)); sdata_parent = IEEE80211_DEV_TO_SUB_IF(dev); - if (sdata_parent->type == IEEE80211_SUB_IF_TYPE_NORM) - sdata->bss = &sdata_parent->u.norm; + if (sdata_parent->type == IEEE80211_SUB_IF_TYPE_AP) + sdata->bss = &sdata_parent->u.ap; else { printk(KERN_DEBUG "%s: could not set BSS pointer for new " "interface %s\n", dev->name, wds_dev->name); @@ -4030,45 +4030,45 @@ int ieee80211_if_add_vlan(struct net_dev } -static void ieee80211_if_norm_init(struct ieee80211_sub_if_data *sdata) +static void ieee80211_if_ap_init(struct ieee80211_sub_if_data *sdata) { - sdata->type = IEEE80211_SUB_IF_TYPE_NORM; - sdata->u.norm.dtim_period = 2; - sdata->u.norm.force_unicast_rateidx = -1; - sdata->u.norm.max_ratectrl_rateidx = -1; - skb_queue_head_init(&sdata->u.norm.ps_bc_buf); - sdata->bss = &sdata->u.norm; + sdata->type = IEEE80211_SUB_IF_TYPE_AP; + sdata->u.ap.dtim_period = 2; + sdata->u.ap.force_unicast_rateidx = -1; + sdata->u.ap.max_ratectrl_rateidx = -1; + skb_queue_head_init(&sdata->u.ap.ps_bc_buf); + sdata->bss = &sdata->u.ap; } -int ieee80211_if_add_norm(struct net_device *dev, char *name, u8 *bssid, +int ieee80211_if_add_ap(struct net_device *dev, char *name, u8 *bssid, int locked) { struct ieee80211_local *local = dev->priv; - struct net_device *norm_dev = NULL; + struct net_device *ap_dev = NULL; struct ieee80211_sub_if_data *sdata = NULL; if (local->bss_dev_count >= local->conf.bss_count) return -ENOBUFS; if (strlen(name) != 0) { - norm_dev = dev_get_by_name(name); - if (norm_dev) { - dev_put(norm_dev); + ap_dev = dev_get_by_name(name); + if (ap_dev) { + dev_put(ap_dev); return -EEXIST; } } - norm_dev = ieee80211_if_add(dev, name, locked); - if (norm_dev == NULL) + ap_dev = ieee80211_if_add(dev, name, locked); + if (ap_dev == NULL) return -ENOANO; - memcpy(norm_dev->dev_addr, bssid, ETH_ALEN); - sdata = IEEE80211_DEV_TO_SUB_IF(norm_dev); - ieee80211_if_norm_init(sdata); - ieee80211_proc_init_virtual(norm_dev); + memcpy(ap_dev->dev_addr, bssid, ETH_ALEN); + sdata = IEEE80211_DEV_TO_SUB_IF(ap_dev); + ieee80211_if_ap_init(sdata); + ieee80211_proc_init_virtual(ap_dev); spin_lock_bh(&local->sub_if_lock); - local->bss_devs[local->bss_dev_count] = norm_dev; + local->bss_devs[local->bss_dev_count] = ap_dev; local->bss_dev_count++; spin_unlock_bh(&local->sub_if_lock); @@ -4172,7 +4172,7 @@ static void ieee80211_if_del(struct ieee } switch (sdata->type) { - case IEEE80211_SUB_IF_TYPE_NORM: + case IEEE80211_SUB_IF_TYPE_AP: /* Remove all virtual interfaces that use this BSS * as their sdata->bss */ list_for_each_safe(ptr, n, &local->sub_if_list) { @@ -4180,7 +4180,7 @@ static void ieee80211_if_del(struct ieee list_entry(ptr, struct ieee80211_sub_if_data, list); - if (tsdata != sdata && tsdata->bss == &sdata->u.norm) { + if (tsdata != sdata && tsdata->bss == &sdata->u.ap) { printk(KERN_DEBUG "%s: removing virtual " "interface %s because its BSS interface" " is being removed\n", @@ -4189,8 +4189,8 @@ static void ieee80211_if_del(struct ieee } } - kfree(sdata->u.norm.beacon_head); - kfree(sdata->u.norm.beacon_tail); + kfree(sdata->u.ap.beacon_head); + kfree(sdata->u.ap.beacon_tail); spin_lock_bh(&local->sub_if_lock); for (j = 0; j < local->bss_dev_count; j++) { if (sdata->dev == local->bss_devs[j]) { @@ -4211,7 +4211,7 @@ static void ieee80211_if_del(struct ieee if (sdata->dev != local->mdev) { struct sk_buff *skb; - while ((skb = skb_dequeue(&sdata->u.norm.ps_bc_buf))) { + while ((skb = skb_dequeue(&sdata->u.ap.ps_bc_buf))) { local->total_ps_buffered--; dev_kfree_skb(skb); } @@ -4310,9 +4310,9 @@ int ieee80211_if_remove_vlan(struct net_ } -int ieee80211_if_remove_norm(struct net_device *dev, char *name, int locked) +int ieee80211_if_remove_ap(struct net_device *dev, char *name, int locked) { - return ieee80211_if_remove(dev, name, IEEE80211_SUB_IF_TYPE_NORM, + return ieee80211_if_remove(dev, name, IEEE80211_SUB_IF_TYPE_AP, locked); } @@ -4483,7 +4483,7 @@ struct net_device *ieee80211_alloc_hw(si sdata->master = mdev; sdata->local = local; ieee80211_if_sdata_init(sdata); - ieee80211_if_norm_init(sdata); + ieee80211_if_ap_init(sdata); list_add_tail(&sdata->list, &local->sub_if_list); if (strlen(dev->name) + 2 >= sizeof(dev->name)) @@ -4524,7 +4524,7 @@ struct net_device *ieee80211_alloc_hw(si sprintf(mdev->name, "%s.11", dev->name); sdata = IEEE80211_DEV_TO_SUB_IF(mdev); - sdata->type = IEEE80211_SUB_IF_TYPE_NORM; + sdata->type = IEEE80211_SUB_IF_TYPE_AP; sdata->dev = mdev; sdata->master = mdev; sdata->local = local; Index: netdev/net/ieee80211/ieee80211_ioctl.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211_ioctl.c 2006-01-05 14:41:59.000000000 +0100 +++ netdev/net/ieee80211/ieee80211_ioctl.c 2006-01-06 16:58:11.000000000 +0100 @@ -50,7 +50,7 @@ static int ieee80211_ioctl_set_beacon(st int flag) { struct ieee80211_sub_if_data *sdata; - struct ieee80211_if_norm *norm; + struct ieee80211_if_ap *ap; u8 **b_head, **b_tail; int *b_head_len, *b_tail_len; int len; @@ -64,16 +64,16 @@ static int ieee80211_ioctl_set_beacon(st return -EINVAL; sdata = IEEE80211_DEV_TO_SUB_IF(dev); - if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + if (sdata->type != IEEE80211_SUB_IF_TYPE_AP) return -EINVAL; - norm = &sdata->u.norm; + ap = &sdata->u.ap; switch (flag) { case 0: - b_head = &norm->beacon_head; - b_tail = &norm->beacon_tail; - b_head_len = &norm->beacon_head_len; - b_tail_len = &norm->beacon_tail_len; + b_head = &ap->beacon_head; + b_tail = &ap->beacon_tail; + b_head_len = &ap->beacon_head_len; + b_tail_len = &ap->beacon_tail_len; break; default: printk(KERN_DEBUG "%s: unknown beacon flag %d\n", @@ -519,7 +519,7 @@ static int ieee80211_ioctl_set_encryptio if (0 /* FIX: more than one STA per AP */) try_hwaccel = 0; } else - if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM || + if (sdata->type != IEEE80211_SUB_IF_TYPE_AP || dev != local->wdev) try_hwaccel = 0; } else { @@ -937,7 +937,7 @@ static int ieee80211_ioctl_add_if(struct if (left < sizeof(struct hostapd_if_bss)) return -EPROTO; - return ieee80211_if_add_norm(dev, param->u.if_info.name, + return ieee80211_if_add_ap(dev, param->u.if_info.name, bss->bssid, 1); } else if (param->u.if_info.type == HOSTAP_IF_STA) { #if 0 @@ -964,7 +964,7 @@ static int ieee80211_ioctl_remove_if(str } else if (param->u.if_info.type == HOSTAP_IF_VLAN) { return ieee80211_if_remove_vlan(dev, param->u.if_info.name, 1); } else if (param->u.if_info.type == HOSTAP_IF_BSS) { - return ieee80211_if_remove_norm(dev, param->u.if_info.name, 1); + return ieee80211_if_remove_ap(dev, param->u.if_info.name, 1); } else if (param->u.if_info.type == HOSTAP_IF_STA) { return ieee80211_if_remove_sta(dev, param->u.if_info.name, 1); } else { @@ -2093,17 +2093,17 @@ ieee80211_ioctl_force_unicast_rate(struc struct ieee80211_local *local = dev->priv; int i; - if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + if (sdata->type != IEEE80211_SUB_IF_TYPE_AP) return -ENOENT; if (rate == 0) { - sdata->u.norm.force_unicast_rateidx = -1; + sdata->u.ap.force_unicast_rateidx = -1; return 0; } for (i = 0; i < local->num_curr_rates; i++) { if (local->curr_rates[i].rate == rate) { - sdata->u.norm.force_unicast_rateidx = i; + sdata->u.ap.force_unicast_rateidx = i; return 0; } } @@ -2119,17 +2119,17 @@ ieee80211_ioctl_max_ratectrl_rate(struct struct ieee80211_local *local = dev->priv; int i; - if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + if (sdata->type != IEEE80211_SUB_IF_TYPE_AP) return -ENOENT; if (rate == 0) { - sdata->u.norm.max_ratectrl_rateidx = -1; + sdata->u.ap.max_ratectrl_rateidx = -1; return 0; } for (i = 0; i < local->num_curr_rates; i++) { if (local->curr_rates[i].rate == rate) { - sdata->u.norm.max_ratectrl_rateidx = i; + sdata->u.ap.max_ratectrl_rateidx = i; return 0; } } @@ -2245,10 +2245,10 @@ static int ieee80211_ioctl_prism2_param( case PRISM2_PARAM_DTIM_PERIOD: if (value < 1) ret = -EINVAL; - else if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + else if (sdata->type != IEEE80211_SUB_IF_TYPE_AP) ret = -ENOENT; else - sdata->u.norm.dtim_period = value; + sdata->u.ap.dtim_period = value; break; case PRISM2_PARAM_IEEE_802_1X: @@ -2486,10 +2486,10 @@ static int ieee80211_ioctl_get_prism2_pa break; case PRISM2_PARAM_DTIM_PERIOD: - if (sdata->type != IEEE80211_SUB_IF_TYPE_NORM) + if (sdata->type != IEEE80211_SUB_IF_TYPE_AP) ret = -ENOENT; else - *param = sdata->u.norm.dtim_period; + *param = sdata->u.ap.dtim_period; break; case PRISM2_PARAM_IEEE_802_1X: Index: netdev/net/ieee80211/ieee80211_proc.c =================================================================== --- netdev.orig/net/ieee80211/ieee80211_proc.c 2006-01-04 16:51:23.000000000 +0100 +++ netdev/net/ieee80211/ieee80211_proc.c 2006-01-06 16:59:37.000000000 +0100 @@ -85,14 +85,14 @@ static char * ieee80211_proc_key(char *p } -static char * ieee80211_proc_sub_if_norm(char *p, - struct ieee80211_if_norm *norm) +static char * ieee80211_proc_sub_if_ap(char *p, + struct ieee80211_if_ap *ap) { - p += sprintf(p, "type=norm\n"); - if (norm->beacon_head) - p += sprintf(p, "beacon_head_len=%d\n", norm->beacon_head_len); - if (norm->beacon_tail) - p += sprintf(p, "beacon_tail_len=%d\n", norm->beacon_tail_len); + p += sprintf(p, "type=ap\n"); + if (ap->beacon_head) + p += sprintf(p, "beacon_head_len=%d\n", ap->beacon_head_len); + if (ap->beacon_tail) + p += sprintf(p, "beacon_tail_len=%d\n", ap->beacon_tail_len); p += sprintf(p, "max_aid=%d\n" "num_sta_ps=%d\n" @@ -102,10 +102,10 @@ static char * ieee80211_proc_sub_if_norm "num_beacons=%d\n" "force_unicast_rateidx=%d\n" "max_ratectrl_rateidx=%d\n", - norm->max_aid, atomic_read(&norm->num_sta_ps), - skb_queue_len(&norm->ps_bc_buf), - norm->dtim_period, norm->dtim_count, norm->num_beacons, - norm->force_unicast_rateidx, norm->max_ratectrl_rateidx); + ap->max_aid, atomic_read(&ap->num_sta_ps), + skb_queue_len(&ap->ps_bc_buf), + ap->dtim_period, ap->dtim_count, ap->num_beacons, + ap->force_unicast_rateidx, ap->max_ratectrl_rateidx); return p; } @@ -163,8 +163,8 @@ static char * ieee80211_proc_sub_if(char p += sprintf(p, "bss=%p\n", sdata->bss); switch (sdata->type) { - case IEEE80211_SUB_IF_TYPE_NORM: - p = ieee80211_proc_sub_if_norm(p, &sdata->u.norm); + case IEEE80211_SUB_IF_TYPE_AP: + p = ieee80211_proc_sub_if_ap(p, &sdata->u.ap); break; case IEEE80211_SUB_IF_TYPE_WDS: p += sprintf(p, "type=wds\n");