Re: [Ndiswrapper-general] compile error for 2.6.27, but not 2.6.25.9
Status: Beta
Brought to you by:
pgiri
From: James S. <Sha...@ea...> - 2008-10-11 22:57:35
|
On Sat, 11 Oct 2008 20:58:14 +0000 (GMT) Hin-Tak Leung <hin...@ya...> wrote: > The prototype of iwe_stream_* has changed in 2.6.27 (or recent wireless-testing) - most of them takes an extra argument. Mostly you need to add an extra argument "info", as the first argument, which should be in the surround code anyway. So a patch might looks like this? The changes I made to compile. And appears to work too. - James --- ./ndiswrapper-1.53/driver/iw_ndis.c 2008-05-27 21:54:08.000000000 -0500 +++ ./ndiswrapper-1.53_27/driver/iw_ndis.c 2008-10-11 17:47:57.000000000 -0500 @@ -1018,6 +1018,7 @@ static char *ndis_translate_scan(struct net_device *dev, char *event, char *end_buf, void *item) { + struct iw_request_info *info = NULL; struct iw_event iwe; char *current_val; int i, nrates; @@ -1034,7 +1035,7 @@ iwe.u.ap_addr.sa_family = ARPHRD_ETHER; iwe.len = IW_EV_ADDR_LEN; memcpy(iwe.u.ap_addr.sa_data, bssid->mac, ETH_ALEN); - event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_ADDR_LEN); + event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_ADDR_LEN); /* add essid */ memset(&iwe, 0, sizeof(iwe)); @@ -1044,13 +1045,13 @@ iwe.u.data.length = IW_ESSID_MAX_SIZE; iwe.u.data.flags = 1; iwe.len = IW_EV_POINT_LEN + iwe.u.data.length; - event = iwe_stream_add_point(event, end_buf, &iwe, bssid->ssid.essid); + event = iwe_stream_add_point(info, event, end_buf, &iwe, bssid->ssid.essid); /* add protocol name */ memset(&iwe, 0, sizeof(iwe)); iwe.cmd = SIOCGIWNAME; strncpy(iwe.u.name, network_type_to_name(bssid->net_type), IFNAMSIZ); - event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_CHAR_LEN); + event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_CHAR_LEN); /* add mode */ memset(&iwe, 0, sizeof(iwe)); @@ -1061,7 +1062,7 @@ iwe.u.mode = IW_MODE_INFRA; else // if (bssid->mode == Ndis802_11AutoUnknown) iwe.u.mode = IW_MODE_AUTO; - event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_UINT_LEN); + event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_UINT_LEN); /* add freq */ memset(&iwe, 0, sizeof(iwe)); @@ -1076,7 +1077,7 @@ /* convert from kHz to Hz */ iwe.u.freq.e += 3; iwe.len = IW_EV_FREQ_LEN; - event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_FREQ_LEN); + event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_FREQ_LEN); /* add qual */ memset(&iwe, 0, sizeof(iwe)); @@ -1090,7 +1091,7 @@ iwe.u.qual.noise = WL_NOISE; iwe.u.qual.qual = i; iwe.len = IW_EV_QUAL_LEN; - event = iwe_stream_add_event(event, end_buf, &iwe, IW_EV_QUAL_LEN); + event = iwe_stream_add_event(info, event, end_buf, &iwe, IW_EV_QUAL_LEN); /* add key info */ memset(&iwe, 0, sizeof(iwe)); @@ -1101,7 +1102,7 @@ iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY; iwe.u.data.length = 0; iwe.len = IW_EV_POINT_LEN; - event = iwe_stream_add_point(event, end_buf, &iwe, bssid->ssid.essid); + event = iwe_stream_add_point(info, event, end_buf, &iwe, bssid->ssid.essid); /* add rate */ memset(&iwe, 0, sizeof(iwe)); @@ -1115,7 +1116,7 @@ if (bssid->rates[i] & 0x7f) { iwe.u.bitrate.value = ((bssid->rates[i] & 0x7f) * 500000); - current_val = iwe_stream_add_value(event, current_val, + current_val = iwe_stream_add_value(info, event, current_val, end_buf, &iwe, IW_EV_PARAM_LEN); } @@ -1128,13 +1129,13 @@ iwe.cmd = IWEVCUSTOM; sprintf(buf, "bcn_int=%d", bssid->config.beacon_period); iwe.u.data.length = strlen(buf); - event = iwe_stream_add_point(event, end_buf, &iwe, buf); + event = iwe_stream_add_point(info, event, end_buf, &iwe, buf); memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVCUSTOM; sprintf(buf, "atim=%u", bssid->config.atim_window); iwe.u.data.length = strlen(buf); - event = iwe_stream_add_point(event, end_buf, &iwe, buf); + event = iwe_stream_add_point(info, event, end_buf, &iwe, buf); TRACE2("%d, %u", bssid->length, (unsigned int)sizeof(*bssid)); if (bssid->length > sizeof(*bssid)) { @@ -1155,7 +1156,7 @@ memset(&iwe, 0, sizeof(iwe)); iwe.cmd = IWEVGENIE; iwe.u.data.length = ielen; - event = iwe_stream_add_point(event, end_buf, + event = iwe_stream_add_point(info, event, end_buf, &iwe, iep); } iep += ielen; |