Ignore:
Timestamp:
03/29/08 20:26:25 (5 years ago)
Author:
BrainSlayer
Message:

wistron ca8-pro/rdaa-81 support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/router/services/sysinit/sysinit-ca8.c

    r9146 r9356  
    5252#include <linux/sockios.h> 
    5353#include <linux/mii.h> 
     54 
     55#include <bcmnvram.h> 
     56#include <shutils.h> 
     57#include <utils.h> 
     58#include <cymac.h> 
    5459 
    5560//highly experimental 
     
    110115/* network drivers */ 
    111116  eval ("insmod", "ar2313"); 
     117  if (getRouterBrand () == ROUTER_BOARD_CA8PRO) 
     118    { 
     119      eval ("ifconfig", "eth0", "up");  // required for vlan config 
     120      eval ("/sbin/vconfig", "set_name_type", "VLAN_PLUS_VID_NO_PAD"); 
     121      eval ("/sbin/vconfig", "add", "eth0", "0"); 
     122      eval ("/sbin/vconfig", "add", "eth0", "1"); 
     123      struct ifreq ifr; 
     124      int s; 
     125      if ((s = socket (AF_INET, SOCK_RAW, IPPROTO_RAW))) 
     126        { 
     127          char eabuf[32]; 
     128          strncpy (ifr.ifr_name, "eth0", IFNAMSIZ); 
     129          ioctl (s, SIOCGIFHWADDR, &ifr); 
     130          char macaddr[32]; 
     131          strcpy (macaddr, 
     132                  ether_etoa ((unsigned char *) ifr.ifr_hwaddr.sa_data, 
     133                              eabuf)); 
     134          nvram_set ("et0macaddr", macaddr); 
     135          MAC_ADD (macaddr); 
     136          ether_atoe (macaddr, (unsigned char *) ifr.ifr_hwaddr.sa_data); 
     137          strncpy (ifr.ifr_name, "vlan1", IFNAMSIZ); 
     138          ioctl (s, SIOCSIFHWADDR, &ifr); 
     139          close (s); 
     140        } 
     141    } 
    112142 
    113143  eval ("insmod", "ath_hal"); 
Note: See TracChangeset for help on using the changeset viewer.