[Madwifi-devel] Problems with byte allignment
Status: Beta
Brought to you by:
otaku
From: kaleda <gad...@so...> - 2004-10-11 13:47:57
|
There are some byte unaligned structures. E.g. struct ieee80211req_mlme or struct ieee80211req_del_key In i386 everything is OK, but on some architectures (xscale) compiler alignes struct members ant the struct gets bigger. iwpriv output: - on i386: delkey (8BE4) : set 7 byte & get 0 setmlme (8BE6) : set 10 byte & get 0 - on xscale: delkey (8BE4) : set 8 byte & get 0 setmlme (8BE6) : set 12 byte & get 0 It would be better to add some pad bytes E.g.: struct ieee80211req_mlme { u_int8_t im_op; /* operation to perform */ u_int8_t pad[3]; // for alignment u_int16_t im_reason; /* 802.11 reason code */ u_int8_t im_macaddr[IEEE80211_ADDR_LEN]; }; or use __attribute__((packed)) So, when you call ioctl via iwpriv, parameters line would be more predictible. -- kaleda |