Changeset 10051


Ignore:
Timestamp:
07/30/08 11:06:31 (5 years ago)
Author:
BrainSlayer
Message:

multiple wds station support

Location:
src/router/services/networking
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/networking/madwifi.c

    r10043 r10051  
    14301430        eval ("iwpriv", var, "wds", "1"); 
    14311431      if (!strcmp (m, "wdsap")) 
    1432         eval ("iwpriv", var, "wdsvlan", "0"); 
     1432        eval ("iwpriv", var, "wdssep", "1"); 
    14331433#ifdef OLD_MADWIFI 
    14341434      if (disablescan) 
     
    14451445 
    14461446  if (!strcmp (m, "wdsap")) 
    1447     eval ("iwpriv", dev, "wdsvlan", "0"); 
     1447    eval ("iwpriv", dev, "wdssep", "1"); 
    14481448 
    14491449  char isolate[32]; 
  • src/router/services/networking/network.c

    r10041 r10051  
    35893589  char *interface, *action, *devaction; 
    35903590// fprintf(stderr,"Hotplug\n"); 
    3591   if (!(interface = getenv ("INTERFACE")) || !(action = getenv ("ACTION")) 
    3592       || !(devaction = getenv ("DEVACTION"))) 
     3591  if (!(interface = getenv ("INTERFACE"))) 
    35933592    return 0; 
    3594 // fprintf(stderr,"Hotplug %s\n",action); 
    3595   if (!strcmp (action, "change")) 
    3596     { 
    3597       char *vlan = getenv ("VLAN"); 
     3593  action = getenv("ACTION"); 
     3594  if (!action) 
     3595    return 0; 
     3596 fprintf(stderr,"Hotplug %s\n",action); 
     3597  if (strncmp(interface,"ath",3)) 
     3598    return 0; 
     3599  //try to parse 
     3600  int ifnum; 
     3601  int stanum; 
     3602  int count = sscanf(interface,"ath%d.sta%d",&ifnum,&stanum); 
     3603  char ifname[32]; 
     3604  sprintf(ifname,"ath%d",ifnum); 
     3605  if (count!=2) 
     3606    return 0; 
    35983607      char bridged[32]; 
    3599       sprintf (bridged, "%s_bridged", interface); 
    3600       if (!strcmp (devaction, "wds_add")) 
    3601         { 
    3602  
    3603           eval ("vconfig", "set_name_type", "DEV_PLUS_VID"); 
    3604           eval ("vconfig", "add", interface, vlan); 
    3605           char devname[32]; 
    3606           sprintf (devname, "%s.%04d", interface, atoi (vlan)); 
    3607  
    3608           syslog (LOG_INFO, "adding WDS Interface %s for Station %s\n", 
    3609                   devname, getenv ("WDSNODE")); 
    3610           eval ("ifconfig", devname, "up"); 
     3608      sprintf (bridged, "ath%d_bridged", ifnum); 
     3609     
     3610      if (!strcmp (devaction, "add")) 
     3611        { 
     3612          fprintf(stderr,"adding WDS %s\n",interface); 
     3613          eval ("ifconfig", interface, "up"); 
    36113614          if (nvram_match (bridged, "1")) 
    3612             br_add_interface (getBridge (interface), devname); 
    3613         } 
    3614       if (!strcmp (devaction, "wds_del")) 
    3615         { 
    3616           eval ("vconfig", "set_name_type", "DEV_PLUS_VID"); 
    3617           char devname[32]; 
    3618           sprintf (devname, "%s.%04d", interface, atoi (vlan)); 
    3619           syslog (LOG_INFO, "removing WDS Interface %s for Station %s\n", 
    3620                   devname, getenv ("WDSNODE")); 
    3621           eval ("ifconfig", devname, "down"); 
     3615            br_add_interface (getBridge (ifname), interface); 
     3616        } 
     3617      if (!strcmp (devaction, "del")) 
     3618        { 
     3619          fprintf(stderr,"removing WDS %s\n",interface); 
     3620          eval ("ifconfig", interface, "down"); 
    36223621          if (nvram_match (bridged, "1")) 
    3623             br_del_interface (getBridge (interface), devname); 
    3624           eval ("vconfig", "rem", devname); 
    3625         } 
    3626     } 
     3622            br_del_interface (getBridge (ifname), interface); 
     3623        } 
    36273624  return 0; 
    36283625#else 
Note: See TracChangeset for help on using the changeset viewer.