Changeset 136 for trunk

Show
Ignore:
Timestamp:
04/08/07 15:42:28 (21 months ago)
Author:
dragorn
Message:

Rolled in patch from JohnyCsh? which handles int and char rfmontx privs on rt2570

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/rt2570inject.c

    r128 r136  
    3030int tx80211_rt2570_init(struct tx80211 *in_tx) 
    3131{ 
    32  
    3332        in_tx->capabilities = tx80211_rt2570_capabilities(); 
    3433        in_tx->open_callthrough = &rt2570_open; 
     
    5655int rt2570_open(struct tx80211 *in_tx) 
    5756{ 
    58  
    5957        char errstr[TX80211_STATUS_MAX]; 
    6058 
    61         /* Call private ioctl "rfmontx" to enable raw TX */ 
    62         if (iwconfig_set_intpriv(in_tx->ifname, "rfmontx", 1, 0, errstr) != 0) { 
    63                 snprintf(in_tx->errstr, TX80211_STATUS_MAX, 
    64                                 "Error enabling rfmontx private ioctl: %s\n", 
    65                                 errstr); 
    66                 return -1; 
    67         } 
     59        /* Call rfmontx to enable raw tx. 
     60         * Some drivers prefer set_intpriv, others charpriv.  Try both. 
     61         */ 
    6862 
    69         return(wtinj_open(in_tx)); 
     63        if (iwconfig_set_charpriv(in_tx->ifname, "rfmontx", "1", errstr) >= 0) 
     64                return(wtinj_open(in_tx)); 
     65 
     66        if (iwconfig_set_intpriv(in_tx->ifname, "rfmontx", 1, 0, errstr) >= 0) 
     67                return(wtinj_open(in_tx)); 
     68 
     69        /* If we reach this point, failed to enable rfmontx */   
     70 
     71        fprintf(stderr, "Error enabling rfmontx private ioctl: %s\n", errstr); 
     72        return -1; 
    7073} 
    7174