Ticket #1284: madwifi-0.9.3-add-tpc-support.diff

File madwifi-0.9.3-add-tpc-support.diff, 2.2 kB (added by mike.taylor@apprion.com, 5 years ago)

Patch to add tpc module parameter for per-packet power control

  • svn.madwifi.org-trunk-2250/ath/if_ath.c

    old new  
    259259static char *autocreate = NULL; 
    260260static char *ratectl = DEF_RATE_CTL; 
    261261static int rfkill = -1; 
     262#ifdef ATH_CAP_TPC 
     263static int tpc = -1; 
     264#endif 
    262265static int countrycode = -1; 
    263266static int outdoor = -1; 
    264267static int xchanmode = -1; 
     
    291294MODULE_PARM(outdoor, "i"); 
    292295MODULE_PARM(xchanmode, "i"); 
    293296MODULE_PARM(rfkill, "i"); 
     297#ifdef ATH_CAP_TPC 
     298MODULE_PARM(tpc, "i"); 
     299#endif 
    294300MODULE_PARM(autocreate, "s"); 
    295301MODULE_PARM(ratectl, "s"); 
    296302#else 
     
    299305module_param(outdoor, int, 0600); 
    300306module_param(xchanmode, int, 0600); 
    301307module_param(rfkill, int, 0600); 
     308#ifdef ATH_CAP_TPC 
     309module_param(tpc, int, 0600); 
     310#endif 
    302311module_param(autocreate, charp, 0600); 
    303312module_param(ratectl, charp, 0600); 
    304313#endif 
     
    306315MODULE_PARM_DESC(outdoor, "Enable/disable outdoor use"); 
    307316MODULE_PARM_DESC(xchanmode, "Enable/disable extended channel mode"); 
    308317MODULE_PARM_DESC(rfkill, "Enable/disable RFKILL capability"); 
     318#ifdef ATH_CAP_TPC 
     319MODULE_PARM_DESC(tpc, "Enable/disable per-packet transmit power control (TPC) capability"); 
     320#endif 
    309321MODULE_PARM_DESC(autocreate, "Create ath device in [sta|ap|wds|adhoc|ahdemo|monitor] mode. defaults to sta, use 'none' to disable"); 
    310322MODULE_PARM_DESC(ratectl, "Rate control algorithm [amrr|minstrel|onoe|sample], defaults to '" DEF_RATE_CTL "'"); 
    311323 
     
    509521                ath_hal_setrfsilent(ah, rfkill); 
    510522        } 
    511523 
     524#ifdef ATH_CAP_TPC 
     525        if (tpc != -1) { 
     526                printk(KERN_INFO "ath_pci: ath_pci: switching per-packet transmit power control %s\n", 
     527                        tpc ? "on" : "off"); 
     528                ath_hal_settpc(ah, tpc); 
     529        } 
     530#endif 
     531 
    512532        /* 
    513533         * Setup rate tables for all potential media types. 
    514534         */