Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 77780 | Differences between
and this patch

Collapse All | Expand All

(-)linux-wlan-ng-0.2.1-pre26-orig/src/p80211/p80211netdev.c (-4 / +5 lines)
Lines 525-531 Link Here
525
		 * and return success .
525
		 * and return success .
526
		 * TODO: we need a saner way to handle this 
526
		 * TODO: we need a saner way to handle this 
527
		 */
527
		 */
528
		if(skb->protocol != ETH_P_80211_RAW) {
528
		if(skb->protocol != htons(ETH_P_80211_RAW)) {
529
			p80211netdev_start_queue(wlandev);
529
			p80211netdev_start_queue(wlandev);
530
			WLAN_LOG_NOTICE(
530
			WLAN_LOG_NOTICE(
531
				"Tx attempt prior to association, frame dropped.\n");
531
				"Tx attempt prior to association, frame dropped.\n");
Lines 537-543 Link Here
537
	}
537
	}
538
		
538
		
539
	/* Check for raw transmits */
539
	/* Check for raw transmits */
540
	if(skb->protocol == ETH_P_80211_RAW) {
540
	if(skb->protocol == htons(ETH_P_80211_RAW)) {
541
		if (!capable(CAP_NET_ADMIN)) {
541
		if (!capable(CAP_NET_ADMIN)) {
542
			return(-EPERM);
542
			return(-EPERM);
543
		}
543
		}
Lines 965-972 Link Here
965
		dev->set_mac_address =	p80211knetdev_set_mac_address;
965
		dev->set_mac_address =	p80211knetdev_set_mac_address;
966
#endif
966
#endif
967
#ifdef HAVE_TX_TIMEOUT
967
#ifdef HAVE_TX_TIMEOUT
968
	dev->tx_timeout      =  &p80211knetdev_tx_timeout;
968
// KoreK: still not implemented 
969
	dev->watchdog_timeo  =  (wlan_watchdog * HZ) / 1000;
969
//	dev->tx_timeout      =  &p80211knetdev_tx_timeout;
970
//	dev->watchdog_timeo  =  (wlan_watchdog * HZ) / 1000;
970
#endif
971
#endif
971
		
972
		
972
	}
973
	}
(-)linux-wlan-ng-0.2.1-pre26-orig/src/prism2/driver/Makefile (-1 / +1 lines)
Lines 88-94 Link Here
88
		MODVERDIR=$(WLAN_SRC)/.tmp_versions modules
88
		MODVERDIR=$(WLAN_SRC)/.tmp_versions modules
89
else # kbuild 2.4
89
else # kbuild 2.4
90
90
91
	$(MAKE) -C $(LINUX_SRC) SUBDIRS=$(PWD) WLAN_SRC=$(PWD) \
91
	$(MAKE) -C $(LINUX_SRC) SUBDIRS=$(PWD) WLAN_SRC=$(WLAN_SRC) \
92
		modules
92
		modules
93
93
94
endif # kbuild switch
94
endif # kbuild switch
(-)linux-wlan-ng-0.2.1-pre26-orig/src/prism2/driver/hfa384x.c (-10 / +39 lines)
Lines 1941-1948 Link Here
1941
1941
1942
	DBFENTER;
1942
	DBFENTER;
1943
1943
1944
	cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1944
	if (enable == HFA384x_MONITOR_ENABLE) {
1945
		HFA384x_CMD_AINFO_SET(enable);
1945
		// KoreK: get into test mode 0x0a
1946
		cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1947
			HFA384x_CMD_AINFO_SET(0x0a);
1948
	} else {
1949
		cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1950
			HFA384x_CMD_AINFO_SET(enable);
1951
	}
1946
	cmd.parm0 = 0;
1952
	cmd.parm0 = 0;
1947
	cmd.parm1 = 0;
1953
	cmd.parm1 = 0;
1948
	cmd.parm2 = 0;
1954
	cmd.parm2 = 0;
Lines 3178-3190 Link Here
3178
		HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);	
3184
		HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);	
3179
#endif
3185
#endif
3180
3186
3181
	/* if we're using host WEP, increase size by IV+ICV */
3187
	if (skb->protocol != htons(ETH_P_80211_RAW)) {
3182
	if (p80211_wep->data) {
3188
		/* if we're using host WEP, increase size by IV+ICV */
3183
		txdesc.data_len = host2hfa384x_16(skb->len+8);
3189
		if (p80211_wep->data) {
3184
		//		txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
3190
			txdesc.data_len = host2hfa384x_16(skb->len+8);
3185
	} else {
3191
			// txdesc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
3186
		txdesc.data_len =  host2hfa384x_16(skb->len);
3192
		} else {
3187
	}
3193
			txdesc.data_len =  host2hfa384x_16(skb->len);
3194
		}
3195
        } else {
3196
		/* KoreK: raw injection (monitor mode): pull the rest of 
3197
		   the header and ssanity check on txdesc.data_len */
3198
		memcpy(&(txdesc.data_len), skb->data, 16);
3199
		skb_pull(skb,16);
3200
		if (txdesc.data_len != host2hfa384x_16(skb->len)) {
3201
			printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
3202
			return 0;
3203
		}
3204
3205
		txdesc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
3206
        }
3188
3207
3189
	txdesc.tx_control = host2hfa384x_16(txdesc.tx_control);
3208
	txdesc.tx_control = host2hfa384x_16(txdesc.tx_control);
3190
	/* copy the header over to the txdesc */
3209
	/* copy the header over to the txdesc */
Lines 3207-3213 Link Here
3207
	spin_lock(&hw->cmdlock);
3226
	spin_lock(&hw->cmdlock);
3208
3227
3209
	/* Copy descriptor+payload to FID */
3228
	/* Copy descriptor+payload to FID */
3210
        if (p80211_wep->data) { 
3229
        if (p80211_wep->data && (skb->protocol != htons(ETH_P_80211_RAW))) { 
3211
		result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0,
3230
		result = hfa384x_copy_to_bap4(hw, HFA384x_BAP_PROC, fid, 0,
3212
					      &txdesc, sizeof(txdesc),
3231
					      &txdesc, sizeof(txdesc),
3213
					      p80211_wep->iv, sizeof(p80211_wep->iv),
3232
					      p80211_wep->iv, sizeof(p80211_wep->iv),
Lines 3657-3662 Link Here
3657
	switch( HFA384x_RXSTATUS_MACPORT_GET(rxdesc.status) )
3676
	switch( HFA384x_RXSTATUS_MACPORT_GET(rxdesc.status) )
3658
	{
3677
	{
3659
	case 0:
3678
	case 0:
3679
		/* KoreK: this testmode uses macport 0 */
3680
		if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
3681
		    (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
3682
			if ( ! HFA384x_RXSTATUS_ISFCSERR(rxdesc.status) ) {
3683
				hfa384x_int_rxmonitor( wlandev, rxfid, &rxdesc);
3684
			} else {
3685
				WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
3686
			}
3687
			goto done;
3688
		}
3660
3689
3661
		fc = ieee2host16(rxdesc.frame_control);
3690
		fc = ieee2host16(rxdesc.frame_control);
3662
3691
(-)linux-wlan-ng-0.2.1-pre26-orig/src/prism2/driver/hfa384x_usb.c (-15 / +54 lines)
Lines 1143-1150 Link Here
1143
1143
1144
	DBFENTER;
1144
	DBFENTER;
1145
1145
1146
	cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1146
	if (enable == HFA384x_MONITOR_ENABLE) {
1147
		HFA384x_CMD_AINFO_SET(enable);
1147
		// KoreK: get into test mode 0x0a
1148
		cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1149
			HFA384x_CMD_AINFO_SET(0x0a);
1150
	} else {
1151
		cmd.cmd = HFA384x_CMD_CMDCODE_SET(HFA384x_CMDCODE_MONITOR) |
1152
			HFA384x_CMD_AINFO_SET(enable);
1153
	}
1148
	cmd.parm0 = 0;
1154
	cmd.parm0 = 0;
1149
	cmd.parm1 = 0;
1155
	cmd.parm1 = 0;
1150
	cmd.parm2 = 0;
1156
	cmd.parm2 = 0;
Lines 3258-3294 Link Here
3258
		HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
3264
		HFA384x_TX_MACPORT_SET(0) | HFA384x_TX_STRUCTYPE_SET(1) |
3259
		HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);	
3265
		HFA384x_TX_TXEX_SET(0) | HFA384x_TX_TXOK_SET(0);	
3260
#endif
3266
#endif
3261
	hw->txbuff.txfrm.desc.tx_control = 
3262
		host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
3263
3267
3264
	/* copy the header over to the txdesc */
3268
	if (skb->protocol != htons(ETH_P_80211_RAW)) {
3265
	memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr, sizeof(p80211_hdr_t));
3269
		hw->txbuff.txfrm.desc.tx_control = 
3270
			host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
3271
3272
		/* copy the header over to the txdesc */
3273
		memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
3274
			sizeof(p80211_hdr_t));
3275
3276
		/* if we're using host WEP, increase size by IV+ICV */
3277
		if (p80211_wep->data) {
3278
			hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
3279
			// hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
3280
			usbpktlen+=8;
3281
		} else {
3282
			hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
3283
		}
3284
	} else  {
3285
		/* KoreK: raw injection (monitor mode): pull the rest of 
3286
		   the header and ssanity check on txdesc.data_len */
3287
		memcpy(&(hw->txbuff.txfrm.desc.data_len), skb->data, 16);
3288
		skb_pull(skb,16);
3289
		if (hw->txbuff.txfrm.desc.data_len != host2hfa384x_16(skb->len)) {
3290
			printk(KERN_DEBUG "mismatch frame_len, drop frame\n");
3291
			return 0;
3292
		}
3266
3293
3267
	/* if we're using host WEP, increase size by IV+ICV */
3294
		hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_RETRYSTRAT_SET(1);
3268
	if (p80211_wep->data) {
3295
		hw->txbuff.txfrm.desc.tx_control  =
3269
		hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len+8);
3296
			host2hfa384x_16(hw->txbuff.txfrm.desc.tx_control);
3270
		// hw->txbuff.txfrm.desc.tx_control |= HFA384x_TX_NOENCRYPT_SET(1);
3297
3271
		usbpktlen+=8;
3298
		/* copy the header over to the txdesc */
3272
	} else {
3299
		memcpy(&(hw->txbuff.txfrm.desc.frame_control), p80211_hdr,
3273
		hw->txbuff.txfrm.desc.data_len = host2hfa384x_16(skb->len);
3300
			sizeof(p80211_hdr_t));
3274
	}
3301
	}
3275
3302
3276
	usbpktlen += skb->len;
3303
	usbpktlen += skb->len;
3277
3304
3278
	/* copy over the WEP IV if we are using host WEP */
3305
	/* copy over the WEP IV if we are using host WEP */
3279
	ptr = hw->txbuff.txfrm.data;
3306
	ptr = hw->txbuff.txfrm.data;
3280
	if (p80211_wep->data) {
3307
	if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
3281
		memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
3308
		memcpy(ptr, p80211_wep->iv, sizeof(p80211_wep->iv));
3282
		ptr+= sizeof(p80211_wep->iv);
3309
		ptr+= sizeof(p80211_wep->iv);
3283
		memcpy(ptr, p80211_wep->data, skb->len);
3310
		memcpy(ptr, p80211_wep->data, skb->len);
3284
	} else {
3311
	} else {
3285
		memcpy(ptr, skb->data, skb->len);
3312
		memcpy(ptr, skb->data, skb->len);
3286
	}
3313
	}
3314
3287
	/* copy over the packet data */
3315
	/* copy over the packet data */
3288
	ptr+= skb->len;
3316
	ptr+= skb->len;
3289
3317
3290
	/* copy over the WEP ICV if we are using host WEP */
3318
	/* copy over the WEP ICV if we are using host WEP */
3291
	if (p80211_wep->data) {
3319
	if (p80211_wep->data && skb->protocol != htons(ETH_P_80211_RAW)) {
3292
		memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
3320
		memcpy(ptr, p80211_wep->icv, sizeof(p80211_wep->icv));
3293
	}
3321
	}
3294
3322
Lines 4105-4110 Link Here
4105
        switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status))
4133
        switch( HFA384x_RXSTATUS_MACPORT_GET(usbin->rxfrm.desc.status))
4106
        {
4134
        {
4107
	case 0:
4135
	case 0:
4136
		/* KoreK: this testmode uses macport 0 */
4137
		if ((wlandev->netdev->type == ARPHRD_IEEE80211) ||
4138
		    (wlandev->netdev->type == ARPHRD_IEEE80211_PRISM)) {
4139
			if ( ! HFA384x_RXSTATUS_ISFCSERR(usbin->rxfrm.desc.status) ) {
4140
				hfa384x_int_rxmonitor(wlandev, &usbin->rxfrm);
4141
			} else {
4142
				WLAN_LOG_DEBUG(3,"Received monitor frame: FCSerr set\n");
4143
			}
4144
			goto done;
4145
		}
4146
4108
		w_hdr = (p80211_hdr_t *) &(usbin->rxfrm.desc.frame_control);
4147
		w_hdr = (p80211_hdr_t *) &(usbin->rxfrm.desc.frame_control);
4109
		fc = ieee2host16(usbin->rxfrm.desc.frame_control);
4148
		fc = ieee2host16(usbin->rxfrm.desc.frame_control);
4110
4149
(-)linux-wlan-ng-0.2.1-pre26-orig/src/prism2/driver/prism2mgmt.c (-3 / +7 lines)
Lines 2855-2863 Link Here
2855
		}
2855
		}
2856
2856
2857
		/* Now if we're already sniffing, we can skip the rest */
2857
		/* Now if we're already sniffing, we can skip the rest */
2858
		if (wlandev->netdev->type != ARPHRD_ETHER) {		
2858
		if ((wlandev->netdev->type != ARPHRD_IEEE80211) && 
2859
		    (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
2859
			/* Set the port type to pIbss */
2860
			/* Set the port type to pIbss */
2860
			word = HFA384x_PORTTYPE_PSUEDOIBSS;
2861
			word = 5; // HFA384x_PORTTYPE_PSUEDOIBSS;
2861
			result = hfa384x_drvr_setconfig16(hw, 
2862
			result = hfa384x_drvr_setconfig16(hw, 
2862
							  HFA384x_RID_CNFPORTTYPE, word);
2863
							  HFA384x_RID_CNFPORTTYPE, word);
2863
			if ( result ) {
2864
			if ( result ) {
Lines 2869-2874 Link Here
2869
			}
2870
			}
2870
			if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) {
2871
			if ((msg->keepwepflags.status == P80211ENUM_msgitem_status_data_ok) && (msg->keepwepflags.data != P80211ENUM_truth_true)) {
2871
				/* Set the wepflags for no decryption */
2872
				/* Set the wepflags for no decryption */
2873
				/* doesn't work - done from the CLI */
2874
				/* Fix? KoreK */
2872
				word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT | 
2875
				word = HFA384x_WEPFLAGS_DISABLE_TXCRYPT | 
2873
					HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
2876
					HFA384x_WEPFLAGS_DISABLE_RXCRYPT;
2874
				result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word);
2877
				result = hfa384x_drvr_setconfig16(hw, HFA384x_RID_CNFWEPFLAGS, word);
Lines 2914-2920 Link Here
2914
			goto failed;
2917
			goto failed;
2915
		}
2918
		}
2916
2919
2917
		if (wlandev->netdev->type == ARPHRD_ETHER) {
2920
		if ((wlandev->netdev->type != ARPHRD_IEEE80211) &&
2921
		    (wlandev->netdev->type != ARPHRD_IEEE80211_PRISM)) {
2918
			WLAN_LOG_INFO("monitor mode enabled\n");
2922
			WLAN_LOG_INFO("monitor mode enabled\n");
2919
		}
2923
		}
2920
2924
(-)linux-wlan-ng-0.2.1-pre26-orig/src/prism2/driver/prism2sta.c (-1 / +2 lines)
Lines 649-655 Link Here
649
	DBFENTER;
649
	DBFENTER;
650
650
651
	/* If necessary, set the 802.11 WEP bit */
651
	/* If necessary, set the 802.11 WEP bit */
652
	if ((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) {
652
	if (((wlandev->hostwep & (HOSTWEP_PRIVACYINVOKED | HOSTWEP_ENCRYPT)) == HOSTWEP_PRIVACYINVOKED) 
653
	    && (skb->protocol != htons(ETH_P_80211_RAW))) {
653
		p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
654
		p80211_hdr->a3.fc |= host2ieee16(WLAN_SET_FC_ISWEP(1));
654
	}
655
	}
655
656

Return to bug 77780