alloc_netdev - allocate network device

Kostas
2007-07-13
2013-02-17
  • Kostas
    Kostas
    2007-07-13

    Hello, in my pc I have 2 wireless cards. One with acx100 and the other with prism2.5 chipsets.
    Both cards are given a wlan%d alias.
    I just want to change thoses alias to acx%d and pri%d respectively.

    I successfully changed the prism driver and works fine with pri%d.
    In the acx driver I do the following:

    File: pci.c
    Line: 1569

    this line --> ndev = alloc_netdev(sizeof(*adev), <b>"wlan%d"</b>, dummy_netdev_init); 
    changed to this --> ndev = alloc_netdev(sizeof(*adev), <b>"acx%d"</b>, dummy_netdev_init);

    In one machine driver loads just fine giving acx%d aliases.
    But on other machine it loads but cannot 'see' the interfaces.

    Anyway, is this 'patching' enough correct ?

     
    • David Planella
      David Planella
      2007-07-13

      Kostas,

      Can you not achieve the renaming of the interfaces by using udev rules?

      It would save you patching and compiling and would be a lot safer and cleaner.

      Cheers

       
    • Kostas
      Kostas
      2007-07-13

      Hello David,

      I don't work with udev. I have build a minimalistic distro for wireless routers and I don't put 'extra' stuff like udev to save memory. I use a static /dev .
      Take a look at http://www.it.teithe.gr/~kontam/neos/main.html . Some is written in Greek and some in English so ignore the Greek stuff.

      thanks for the reply anyway.

       
    • Kostas
      Kostas
      2007-08-09

      finally i found the problem. the "patch" above is correct.
      the problem was in the hotplug scripts.

      you should create a static variable like
      static char dev_name[16] = "acx%d" ;
      so the user can change it easily. 

      I needed that cause in my router I have a prism & acx100 based cards and both drivers give "wlan" aliases.