2012-06-22 76 views
0

我正在寫一個需要從這個聯盟讀取bitrate價值內核模塊:從無線設備驅動程序獲取比特率的值。

union iwreq_data 
{== 
    ....... 
    struct iw_param bitrate; /* default bit rate */ 

    .... 
} 

此代碼形式wireless.h有誰知道我可以訪問它的價值? (我使用的是Linux內核2.6.35)

+0

最好檢查'struct iw_param'成員。 –

+0

這不是我的意思...我的意思是如何訪問'比特率 - >值'..起訴什麼?無線設備?或者是什麼? –

回答

1

有沒有辦法做到這一點,可惜......

iw_param結構左看右看,我們發現

struct iw_param 
{ 
    __s32  value;  /* The value of the parameter itself */ 
    __u8  fixed;  /* Hardware should not use auto select */ 
    __u8  disabled; /* Disable the feature */ 
    __u16  flags;  /* Various specifc flags (if any) */ 
}; 

現在,這裏的代碼看起來像在wireless.h

union iwreq_data 
{ 
    /* Config - generic */ 
    char  name[IFNAMSIZ]; 
    /* Name : used to verify the presence of wireless extensions. 
    * Name of the protocol/provider... */ 

    struct iw_point essid;  /* Extended network name */ 
    struct iw_param nwid;  /* network id (or domain - the cell) */ 
    struct iw_freq freq;  /* frequency or channel : 
        * 0-1000 = channel 
        * > 1000 = frequency in Hz */ 

    struct iw_param sens;  /* signal level threshold */ 
    struct iw_param bitrate; /* default bit rate */ 
    struct iw_param txpower; /* default transmit power */ 
    struct iw_param rts;  /* RTS threshold threshold */ 
    struct iw_param frag;  /* Fragmentation threshold */ 
    __u32  mode;  /* Operation mode */ 
    struct iw_param retry;  /* Retry limits & lifetime */ 

    struct iw_point encoding; /* Encoding stuff : tokens */ 
    struct iw_param power;  /* PM duration/timeout */ 
    struct iw_quality qual;  /* Quality part of statistics */ 

    struct sockaddr ap_addr; /* Access point address */ 
    struct sockaddr addr;  /* Destination address (hw/mac) */ 

    struct iw_param param;  /* Other small parameters */ 
    struct iw_point data;  /* Other large parameters */ 
}; 

我不能想辦法來訪問它除了bitrate->value