[PATCH] libertas: cleanup - remove some private defines.

Andreas Henriksson andreas at fjortis.info
Tue Jul 4 02:57:54 EDT 2006


No real changes...

replace MRVDRV_ETH_ADDR_LEN with globally defined ETH_ALEN
replace MRVDRV_MAXIMUM_ETH_PACKET_SIZE with globally defined ETH_FRAME_LEN
remove unused MRVDRV_TIMER_*
replace/remove TRUE/FALSE

Signed-off-by: Andreas Henriksson <andreas at fjortis.info>

diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 2e32230..126d7a2 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -347,7 +347,7 @@ struct HostCmd_DS_MAC_CONTROL {
 struct HostCmd_DS_MAC_MULTICAST_ADR {
 	u16 Action;
 	u16 NumOfAdrs;
-	u8 MACList[MRVDRV_ETH_ADDR_LEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
+	u8 MACList[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
 };
 
 /* HostCmd_CMD_802_11_AUTHENTICATE */
@@ -400,7 +400,7 @@ struct HostCmd_DS_802_11_ASSOCIATE_RSP {
 /* HostCmd_RET_802_11_AD_HOC_JOIN */
 struct HostCmd_DS_802_11_AD_HOC_RESULT {
 	u8 PAD[3];
-	u8 BSSID[MRVDRV_ETH_ADDR_LEN];
+	u8 BSSID[ETH_ALEN];
 };
 
 /* HostCmd_CMD_802_11_SET_WEP */
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 7a2d424..83326fa 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -239,7 +239,7 @@ static int if_usb_probe(struct usb_inter
 				       "Rx URB allocation failed\n");
 				goto dealloc;
 			}
-			usb_cardp->rx_urb_recall = FALSE;
+			usb_cardp->rx_urb_recall = 0;
 
 			usb_cardp->bulk_in_size =
 			    endpoint->wMaxPacketSize;
@@ -330,7 +330,7 @@ static void if_usb_disconnect(struct usb
 	 *  Free all the URB's allocated 
 	 */
 	if (!Adapter->SurpriseRemoved) {
-		Adapter->SurpriseRemoved = TRUE;
+		Adapter->SurpriseRemoved = 1;
 	}
 
 	/* Unlink and free urb */
@@ -510,16 +510,16 @@ static void if_usb_receive_fwload(struct
 		PRINTM(INFO, "FW received Blk with correct CRC\n");
 		PRINTM(INFO, "FW received Blk SeqNum = %d\n",
 		       SyncFWHeader->SeqNum);
-		cardp->CRC_OK = TRUE;
+		cardp->CRC_OK = 1;
 	} else {
 		PRINTM(INFO, "FW received Blk with CRC error\n");
-		cardp->CRC_OK = FALSE;
+		cardp->CRC_OK = 0;
 	}
 
 	kfree_skb(skb);
 
 	if (cardp->FWFinalBlk) {
-		cardp->FwDnldOver = TRUE;
+		cardp->FwDnldOver = 1;
 		goto exit;
 	}
 
@@ -574,7 +574,7 @@ #define MRVDRV_MIN_PKT_LEN	30
 	} else if (urb->status) {
 		if (!cardp->rx_urb_recall) {
 			PRINTM(INFO, "Card Is Removed\n");
-			priv->adapter->SurpriseRemoved = TRUE;
+			priv->adapter->SurpriseRemoved = 1;
 			// Wake up main thread to handle card removal.
 			if_usb_interrupt(priv, 0, 0);
 		}
@@ -952,7 +952,7 @@ int if_prog_firmware(wlan_private * priv
 		PRINTM(INFO, "Donwloading FW JUMP BLOCK\n");
 		memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE);
 		usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE);
-		cardp->FWFinalBlk = TRUE;
+		cardp->FWFinalBlk = 1;
 	}
 
 	PRINTM(INFO, "The firmware download is done size is %d\n",
@@ -978,15 +978,15 @@ int sbi_prog_firmware(wlan_private * pri
 	ENTER();
 
 restart:
-	priv->adapter->fw_ready = FALSE;
+	priv->adapter->fw_ready = 0;
 
 	cardp->TotalBytes = 0;
 	cardp->FwLastBlkSent = 0;
-	cardp->CRC_OK = TRUE;
-	cardp->FwDnldOver = FALSE;
+	cardp->CRC_OK = 1;
+	cardp->FwDnldOver = 0;
 	cardp->FWSeqNum = -1;
 	cardp->TotalBytes = 0;
-	cardp->FWFinalBlk = FALSE;
+	cardp->FWFinalBlk = 0;
 
 	if_prog_firmware(priv);
 
@@ -1016,7 +1016,7 @@ restart:
 	/* Delay 200 ms to waiting for the FW ready */
 	msleep_interruptible(200);
 
-	priv->adapter->fw_ready = TRUE;
+	priv->adapter->fw_ready = 1;
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -1081,7 +1081,7 @@ static int if_usb_suspend(struct usb_int
 	usb_kill_urb(cardp->tx_urb);
 	usb_kill_urb(cardp->rx_urb);
 
-	cardp->rx_urb_recall = TRUE;
+	cardp->rx_urb_recall = 1;
 
 	LEAVE();
 	return 0;
@@ -1093,7 +1093,7 @@ static int if_usb_resume(struct usb_inte
 
 	ENTER();
 
-	cardp->rx_urb_recall = FALSE;
+	cardp->rx_urb_recall = 0;
 
 	if_usb_submit_rx_urb(cardp->priv);
 
diff --git a/drivers/net/wireless/libertas/wlan_11d.c b/drivers/net/wireless/libertas/wlan_11d.c
index 25c3436..1455f5b 100644
--- a/drivers/net/wireless/libertas/wlan_11d.c
+++ b/drivers/net/wireless/libertas/wlan_11d.c
@@ -169,12 +169,12 @@ static u8 wlan_get_chan_11d(u8 band, u8 
 		/*if beyond the boundary */
 		if (i + NoOfChan < cfp_no) {
 			*chan = (cfp + i + NoOfChan)->Channel;
-			return TRUE;
+			return 1;
 		}
 	}
 
 	LEAVE();
-	return FALSE;
+	return 0;
 }
 
 /** 
@@ -198,13 +198,13 @@ u8 wlan_channel_known_11d(u8 chan,
 		if (chan == chanPwr[i].chan) {
 			PRINTM(INFO, "11D: Found Chan:%d\n", chan);
 			LEAVE();
-			return TRUE;
+			return 1;
 		}
 	}
 
 	PRINTM(INFO, "11D: Not Find Chan:%d\n", chan);
 	LEAVE();
-	return FALSE;
+	return 0;
 }
 
 /** 
@@ -373,23 +373,23 @@ u8 wlan_region_chan_supported_11d(u8 reg
 	ENTER();
 
 	if ((cfp = wlan_get_region_cfp_table(region, band, &cfp_no)) == NULL) {
-		return FALSE;
+		return 0;
 	}
 
 	for (idx = 0; idx < cfp_no; idx++) {
 		if (chan == (cfp + idx)->Channel) {
 			/* If Mrvl Chip Supported? */
 			if ((cfp + idx)->Unsupported) {
-				return FALSE;
+				return 0;
 			} else {
-				return TRUE;
+				return 1;
 			}
 		}
 	}
 
 	/*chan is not in the region table */
 	LEAVE();
-	return FALSE;
+	return 0;
 }
 
 /** 
@@ -463,8 +463,7 @@ int wlan_parse_domain_info_11d(struct IE
 		for (i = 0; idx < MAX_NO_OF_CHAN && i < NoOfChan; i++) {
 			/*step4: channel is supported? */
 
-			if (wlan_get_chan_11d(band, firstChan, i, &curChan)
-			    == FALSE) {
+			if (!wlan_get_chan_11d(band, firstChan, i, &curChan)) {
 				/* Chan is not found in UN table */
 				PRINTM(INFO, "chan is not supported: %d \n", i);
 				break;
@@ -636,7 +635,7 @@ int wlan_set_universaltable(wlan_private
 		       Adapter->universal_channel[i].NrCFP);
 
 		Adapter->universal_channel[i].CFP = channel_freq_power_UN_BG;
-		Adapter->universal_channel[i].Valid = TRUE;
+		Adapter->universal_channel[i].Valid = 1;
 		Adapter->universal_channel[i].Region = UNIVERSAL_REGION_CODE;
 		Adapter->universal_channel[i].Band = band;
 		i++;
diff --git a/drivers/net/wireless/libertas/wlan_cmd.c b/drivers/net/wireless/libertas/wlan_cmd.c
index ea17c02..db211b4 100644
--- a/drivers/net/wireless/libertas/wlan_cmd.c
+++ b/drivers/net/wireless/libertas/wlan_cmd.c
@@ -56,10 +56,10 @@ static u8 Is_Command_Allowed_In_PS(u16 C
 
 	for (i = 0; i < count; i++) {
 		if (Command == wlan_cpu_to_le16(Commands_Allowed_In_PS[i]))
-			return TRUE;
+			return 1;
 	}
 
-	return FALSE;
+	return 0;
 }
 
 /** 
@@ -1203,7 +1203,7 @@ void QueueCmd(wlan_adapter * Adapter, st
 		struct HostCmd_DS_802_11_PS_MODE *psm = &CmdPtr->params.psmode;
 		if (psm->Action == HostCmd_SubCmd_Exit_PS) {
 			if (Adapter->PSState != PS_STATE_FULL_POWER)
-				addtail = FALSE;
+				addtail = 0;
 		}
 	}
 
@@ -1283,7 +1283,7 @@ static int DownloadCommandToStation(wlan
 
 	Command = wlan_cpu_to_le16(CmdPtr->Command);
 
-	CmdNode->CmdWaitQWoken = FALSE;
+	CmdNode->CmdWaitQWoken = 0;
 	CmdSize = wlan_cpu_to_le16(CmdSize);
 
 	ret = sbi_host_to_card(priv, MVMS_CMD, (u8 *) CmdPtr, CmdSize);
@@ -1722,9 +1722,9 @@ #define ACTION_NUMLED_TLVTYPE_LEN_FIELDS
 		goto done;
 	}
 
-	CmdNode->CmdWaitQWoken = FALSE;
+	CmdNode->CmdWaitQWoken = 0;
 
-	QueueCmd(Adapter, CmdNode, TRUE);
+	QueueCmd(Adapter, CmdNode, 1);
 	wake_up_interruptible(&priv->MainThread.waitQ);
 
 	sbi_reenable_host_interrupt(priv, 0x00);
@@ -1903,7 +1903,7 @@ void CleanUpCmdCtrlNode(struct CmdCtrlNo
 
 	if (!pTempNode)
 		return;
-	pTempNode->CmdWaitQWoken = TRUE;
+	pTempNode->CmdWaitQWoken = 1;
 	wake_up_interruptible(&pTempNode->cmdwait_q);
 	pTempNode->Status = 0;
 	pTempNode->cmd_oid = (u32) 0;
@@ -2022,7 +2022,7 @@ int ExecuteNextCommand(wlan_private * pr
 				    ) {
 					/* w/ new scheme, it will not reach here.
 					   since it is blocked in main_thread. */
-					Adapter->NeedToWakeup = TRUE;
+					Adapter->NeedToWakeup = 1;
 				} else
 					PSWakeup(priv, 0);
 
@@ -2057,7 +2057,7 @@ int ExecuteNextCommand(wlan_private * pr
 					       "EXEC_NEXT_CMD: Ignore ExitPS cmd in sleep\n");
 					list_del((struct list_head *)CmdNode);
 					CleanupAndInsertCmd(priv, CmdNode);
-					Adapter->NeedToWakeup = TRUE;
+					Adapter->NeedToWakeup = 1;
 
 					ret = WLAN_STATUS_SUCCESS;
 					goto done;
diff --git a/drivers/net/wireless/libertas/wlan_cmdresp.c b/drivers/net/wireless/libertas/wlan_cmdresp.c
index 195d3c6..da58c8d 100644
--- a/drivers/net/wireless/libertas/wlan_cmdresp.c
+++ b/drivers/net/wireless/libertas/wlan_cmdresp.c
@@ -93,10 +93,10 @@ void MacEventDisconnected(wlan_private *
 	       Adapter->PreviousSSID.Ssid, Adapter->PreviousSSID.SsidLength);
 
 	/* reset internal flags */
-	Adapter->AdHocCreated = FALSE;
+	Adapter->AdHocCreated = 0;
 
-	Adapter->SecInfo.WPAEnabled = FALSE;
-	Adapter->SecInfo.WPA2Enabled = FALSE;
+	Adapter->SecInfo.WPAEnabled = 0;
+	Adapter->SecInfo.WPA2Enabled = 0;
 	Adapter->Wpa_ie_len = 0;
 	Adapter->SecInfo.Auth1XAlg = WLAN_1X_AUTH_ALG_NONE;
 	Adapter->SecInfo.EncryptionMode = CIPHER_NONE;
@@ -111,7 +111,7 @@ void MacEventDisconnected(wlan_private *
 	memcpy(&Adapter->PreviousSSID,
 	       &Adapter->CurBssParams.ssid, sizeof(struct WLAN_802_11_SSID));
 	memcpy(Adapter->PreviousBSSID,
-	       Adapter->CurBssParams.bssid, MRVDRV_ETH_ADDR_LEN);
+	       Adapter->CurBssParams.bssid, ETH_ALEN);
 
 	/* need to erase the current SSID and BSSID info */
 	Adapter->pAttemptedBSSDesc = 0;
@@ -142,7 +142,7 @@ static void HandleDisconnectEvent(wlan_p
 	if (Adapter->MediaConnectStatus == WlanMediaStateConnected) {
 		MacEventDisconnected(priv);
 #ifdef REASSOCIATION
-		if (Adapter->Reassoc_on == TRUE) {
+		if (Adapter->Reassoc_on) {
 			PRINTM(INFO, "RE-ASSOC: trigger the timer\n");
 			mod_timer(&Adapter->reassoc_timer, 0);
 		}
@@ -291,7 +291,7 @@ static int wlan_ret_get_hw_spec(wlan_pri
 
 	if (Adapter->CurrentAddr[0] == 0xff) {
 		memmove(Adapter->CurrentAddr, hwspec->PermanentAddr,
-			MRVDRV_ETH_ADDR_LEN);
+			ETH_ALEN);
 	}
 
 	memcpy(priv->wlan_dev.netdev->dev_addr, Adapter->CurrentAddr, ETH_ALEN);
@@ -508,7 +508,7 @@ static int wlan_ret_802_11_key_material(
 	ENTER();
 
 	if (pKey->Action == HostCmd_ACT_SET)
-		Adapter->IsGTK_SET = TRUE;
+		Adapter->IsGTK_SET = 1;
 
 	memcpy(Adapter->aeskey.KeyParamSet.Key, pKey->KeyParamSet.Key,
 	       sizeof(pKey->KeyParamSet.Key));
@@ -856,7 +856,7 @@ int wlan_process_rx_command(wlan_private
 					    Wlan802_11PowerModeCAM;
 			}
 		} else if (psmode->Action == HostCmd_SubCmd_Enter_PS) {
-			Adapter->NeedToWakeup = FALSE;
+			Adapter->NeedToWakeup = 0;
 			Adapter->PSState = PS_STATE_AWAKE;
 
 			PRINTM(INFO, "CMD_RESP: Enter_PS command response\n");
@@ -871,7 +871,7 @@ int wlan_process_rx_command(wlan_private
 				PSWakeup(priv, 0);
 			}
 		} else if (psmode->Action == HostCmd_SubCmd_Exit_PS) {
-			Adapter->NeedToWakeup = FALSE;
+			Adapter->NeedToWakeup = 0;
 			Adapter->PSState = PS_STATE_FULL_POWER;
 			PRINTM(INFO, "CMD_RESP: Exit_PS command response\n");
 		} else {
@@ -1162,7 +1162,7 @@ int wlan_process_event(wlan_private * pr
 		}
 
 		Adapter->TxLockFlag = 0;
-		if (TRUE == CheckLastPacketIndication(priv)) {
+		if (CheckLastPacketIndication(priv)) {
 			if (Adapter->gen_null_pkg) {
 				SendNullPacket(priv,
 					       MRVDRV_TxPD_POWER_MGMT_NULL_PACKET
@@ -1174,7 +1174,7 @@ int wlan_process_event(wlan_private * pr
 
 		Adapter->PSState = PS_STATE_AWAKE;
 
-		if (Adapter->NeedToWakeup == TRUE) {
+		if (Adapter->NeedToWakeup) {
 			/*
 			 * wait for the command processing to finish
 			 * before resuming sending 
diff --git a/drivers/net/wireless/libertas/wlan_debug.c b/drivers/net/wireless/libertas/wlan_debug.c
index fb613eb..96d79d1 100644
--- a/drivers/net/wireless/libertas/wlan_debug.c
+++ b/drivers/net/wireless/libertas/wlan_debug.c
@@ -165,7 +165,7 @@ static int wlan_debug_write(struct file 
 			else if (d[i].size == 4)
 				*((u32 *) d[i].addr) = (u32) r;
 			break;
-		} while (TRUE);
+		} while (1);
 	}
 	kfree(pdata);
 
diff --git a/drivers/net/wireless/libertas/wlan_defs.h b/drivers/net/wireless/libertas/wlan_defs.h
index 994b362..e3aa2e5 100644
--- a/drivers/net/wireless/libertas/wlan_defs.h
+++ b/drivers/net/wireless/libertas/wlan_defs.h
@@ -156,17 +156,6 @@ #else
 #define HEXDUMP(x,y,z)
 #endif
 
-#ifndef	TRUE
-#define TRUE			1
-#endif
-#ifndef	FALSE
-#define	FALSE			0
-#endif
-
-#ifndef MIN
-#define MIN(a,b)		((a) < (b) ? (a) : (b))
-#endif
-
 #ifndef NELEMENTS
 #define NELEMENTS(x) (sizeof(x)/sizeof(x[0]))
 #endif
@@ -193,21 +182,12 @@ #define MRVDRV_NUM_OF_CMD_BUFFER        
 #define MRVDRV_SIZE_OF_CMD_BUFFER       (2 * 1024)
 #define MRVDRV_MAX_CHANNEL_SIZE		14
 #define MRVDRV_MAX_BSSID_LIST		64
-#define MRVDRV_TIMER_10S		10000
-#define MRVDRV_TIMER_5S			5000
-#define MRVDRV_TIMER_1S			1000
 #define MRVDRV_ASSOCIATION_TIME_OUT	255
 #define MRVDRV_SNAP_HEADER_LEN          8
-#define MRVDRV_ETH_ADDR_LEN             6
-#define MRVDRV_ETH_HEADER_SIZE          14
 
 #define	WLAN_UPLD_SIZE			2312
 #define DEV_NAME_LEN			32
 
-#ifndef	ETH_ALEN
-#define ETH_ALEN			6
-#endif
-
 /** Misc constants */
 /* This section defines 802.11 specific contants */
 
@@ -281,13 +261,12 @@ #define MRVL_FIXED_IE_SIZE      12
 
 /* This is for firmware specific length */
 #define EXTRA_LEN	36
-#define MRVDRV_MAXIMUM_ETH_PACKET_SIZE	1514
 
 #define MRVDRV_ETH_TX_PACKET_BUFFER_SIZE \
-	(MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(struct TxPD) + EXTRA_LEN)
+	(ETH_FRAME_LEN + sizeof(struct TxPD) + EXTRA_LEN)
 
 #define MRVDRV_ETH_RX_PACKET_BUFFER_SIZE \
-	(MRVDRV_MAXIMUM_ETH_PACKET_SIZE + sizeof(struct RxPD) \
+	(ETH_FRAME_LEN + sizeof(struct RxPD) \
 	 + MRVDRV_SNAP_HEADER_LEN + EXTRA_LEN)
 
 #define	CMD_F_HOSTCMD		(1 << 0)
diff --git a/drivers/net/wireless/libertas/wlan_dev.h b/drivers/net/wireless/libertas/wlan_dev.h
index 1e7aa86..5a29d6a 100644
--- a/drivers/net/wireless/libertas/wlan_dev.h
+++ b/drivers/net/wireless/libertas/wlan_dev.h
@@ -94,7 +94,7 @@ struct wlan_802_11_security {
 struct current_bss_params {
 	struct bss_descriptor BSSDescriptor;
 	/** bssid */
-	u8 bssid[MRVDRV_ETH_ADDR_LEN];
+	u8 bssid[ETH_ALEN];
 	/** ssid */
 	struct WLAN_802_11_SSID ssid;
 
@@ -235,7 +235,7 @@ #endif				/* REASSOCIATION */
 
 	struct WLAN_802_11_SSID AttemptedSSIDBeforeScan;
 	struct WLAN_802_11_SSID PreviousSSID;
-	u8 PreviousBSSID[MRVDRV_ETH_ADDR_LEN];
+	u8 PreviousBSSID[ETH_ALEN];
 
 	struct bss_descriptor *ScanTable;
 	u32 NumInScanTable;
@@ -258,9 +258,8 @@ #endif				/* REASSOCIATION */
 	u8 ATIMEnabled;
 
 	/** MAC address information */
-	u8 CurrentAddr[MRVDRV_ETH_ADDR_LEN];
-	u8 MulticastList[MRVDRV_MAX_MULTICAST_LIST_SIZE]
-	    [MRVDRV_ETH_ADDR_LEN];
+	u8 CurrentAddr[ETH_ALEN];
+	u8 MulticastList[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
 	u32 NumOfMulticastMACAddr;
 
 	/** 802.11 statistics */
diff --git a/drivers/net/wireless/libertas/wlan_fw.c b/drivers/net/wireless/libertas/wlan_fw.c
index 80108f3..5ee8478 100644
--- a/drivers/net/wireless/libertas/wlan_fw.c
+++ b/drivers/net/wireless/libertas/wlan_fw.c
@@ -92,7 +92,7 @@ #define RF_REG_VALUE  0xc8
 	/*
 	 * Read MAC address from HW
 	 */
-	memset(adapter->CurrentAddr, 0xff, MRVDRV_ETH_ADDR_LEN);
+	memset(adapter->CurrentAddr, 0xff, ETH_ALEN);
 
 	ret = PrepareAndSendCommand(priv, HostCmd_CMD_GET_HW_SPEC,
 				    0, HostCmd_OPTION_WAITFORRSP, 0, NULL);
@@ -182,11 +182,11 @@ static void wlan_init_adapter(wlan_priva
 
 	/* ATIM params */
 	Adapter->AtimWindow = 0;
-	Adapter->ATIMEnabled = FALSE;
+	Adapter->ATIMEnabled = 0;
 
 	Adapter->MediaConnectStatus = WlanMediaStateDisconnected;
 	Adapter->LinkSpeed = MRVDRV_LINK_SPEED_1mbps;
-	memset(Adapter->CurrentAddr, 0xff, MRVDRV_ETH_ADDR_LEN);
+	memset(Adapter->CurrentAddr, 0xff, ETH_ALEN);
 
 	/* Status variables */
 	Adapter->HardwareStatus = WlanHardwareStatusInitializing;
@@ -219,19 +219,19 @@ #endif
 	memset(&Adapter->CurBssParams, 0, sizeof(Adapter->CurBssParams));
 
 	/* PnP and power profile */
-	Adapter->SurpriseRemoved = FALSE;
+	Adapter->SurpriseRemoved = 0;
 
 	Adapter->CurrentPacketFilter =
 	    HostCmd_ACT_MAC_RX_ON | HostCmd_ACT_MAC_TX_ON;
 
 	Adapter->RadioOn = RADIO_ON;
 #ifdef REASSOCIATION
-	Adapter->Reassoc_on = TRUE;
+	Adapter->Reassoc_on = 1;
 #endif				/* REASSOCIATION */
 	Adapter->TxAntenna = RF_ANTENNA_2;
 	Adapter->RxAntenna = RF_ANTENNA_AUTO;
 
-	Adapter->Is_DataRate_Auto = TRUE;
+	Adapter->Is_DataRate_Auto = 1;
 	Adapter->BeaconPeriod = MRVDRV_BEACON_INTERVAL;
 
 	// set default value of capInfo.
@@ -247,12 +247,12 @@ #define SHORT_PREAMBLE_ALLOWED		1
 	Adapter->ListenInterval = MRVDRV_DEFAULT_LISTEN_INTERVAL;
 
 	Adapter->PSState = PS_STATE_FULL_POWER;
-	Adapter->NeedToWakeup = FALSE;
+	Adapter->NeedToWakeup = 0;
 	Adapter->LocalListenInterval = 0;	/* default value in firmware will be used */
 
 	Adapter->DataRate = 0;	// Initially indicate the rate as auto 
 
-	Adapter->adhoc_grate_enabled = FALSE;
+	Adapter->adhoc_grate_enabled = 0;
 
 	Adapter->IntCounter = Adapter->IntCounterSaved = 0;
 
@@ -388,7 +388,7 @@ void command_timer_fn(unsigned long data
 	spin_unlock_irqrestore(&Adapter->QueueSpinLock, flags);
 
 	PRINTM(INFO, "Re-sending same command as it timeout...!\n");
-	QueueCmd(Adapter, pTempNode, FALSE);
+	QueueCmd(Adapter, pTempNode, 0);
 
 	wake_up_interruptible(&priv->MainThread.waitQ);
 
diff --git a/drivers/net/wireless/libertas/wlan_join.c b/drivers/net/wireless/libertas/wlan_join.c
index 3fcb08e..a97c17d 100644
--- a/drivers/net/wireless/libertas/wlan_join.c
+++ b/drivers/net/wireless/libertas/wlan_join.c
@@ -63,7 +63,7 @@ static int get_common_rates(wlan_adapter
 	int i;
 
 	memset(&tmp, 0, sizeof(tmp));
-	memcpy(&tmp, rate1, MIN(rate1_size, sizeof(tmp)));
+	memcpy(&tmp, rate1, min(rate1_size, sizeof(tmp)));
 	memset(rate1, 0, rate1_size);
 
 	/* Mask the top bit of the original values */
@@ -235,7 +235,7 @@ #endif				/* REASSOCIATION */
 			}
 		}
 		if (Adapter->Prescan)
-			SendSpecificSSIDScan(priv, &reqSSID, TRUE);
+			SendSpecificSSIDScan(priv, &reqSSID, 1);
 		i = FindSSIDInList(Adapter, &reqSSID, NULL,
 				   Wlan802_11Infrastructure);
 		if (i >= 0) {
@@ -275,7 +275,7 @@ #endif				/* REASSOCIATION */
 		/* Scan for the network, do not save previous results.  Stale
 		 *   scan data will cause us to join a non-existant adhoc network
 		 */
-		SendSpecificSSIDScan(priv, &reqSSID, FALSE);
+		SendSpecificSSIDScan(priv, &reqSSID, 0);
 
 		/* Search for the requested SSID in the scan table */
 		i = FindSSIDInList(Adapter, &reqSSID, NULL, Wlan802_11IBSS);
@@ -452,7 +452,7 @@ int StartAdhocNetwork(wlan_private * pri
 
 	ENTER();
 
-	Adapter->AdhocCreate = TRUE;
+	Adapter->AdhocCreate = 1;
 
 	if (!Adapter->capInfo.ShortPreamble) {
 		PRINTM(INFO, "AdhocStart: Long Preamble\n");
@@ -529,7 +529,7 @@ int JoinAdhocNetwork(wlan_private * priv
 	       Adapter->CurBssParams.channel);
 	PRINTM(INFO, "CurBssParams.band = %c\n", Adapter->CurBssParams.band);
 
-	Adapter->AdhocCreate = FALSE;
+	Adapter->AdhocCreate = 0;
 
 	// store the SSID info temporarily
 	memset(&Adapter->AttemptedSSIDBeforeScan, 0,
@@ -609,7 +609,7 @@ int wlanidle_off(wlan_private * priv)
 					SendSpecificBSSIDScan(priv,
 							      Adapter->
 							      PreviousBSSID,
-							      TRUE);
+							      1);
 					i = FindSSIDInList(Adapter,
 							   &Adapter->
 							   PreviousSSID,
@@ -632,7 +632,7 @@ int wlanidle_off(wlan_private * priv)
 					SendSpecificSSIDScan(priv,
 							     &Adapter->
 							     PreviousSSID,
-							     TRUE);
+							     1);
 					i = FindSSIDInList(Adapter,
 							   &Adapter->
 							   PreviousSSID, NULL,
@@ -723,7 +723,7 @@ int wlan_cmd_802_11_authenticate(wlan_pr
 			     + S_DS_GEN);
 
 	pAuthenticate->AuthType = Adapter->SecInfo.AuthenticationMode;
-	memcpy(pAuthenticate->MacAddr, bssid, MRVDRV_ETH_ADDR_LEN);
+	memcpy(pAuthenticate->MacAddr, bssid, ETH_ALEN);
 
 	PRINTM(INFO, "AUTH_CMD: Bssid is : %x:%x:%x:%x:%x:%x\n",
 	       bssid[0], bssid[1], bssid[2], bssid[3], bssid[4], bssid[5]);
@@ -753,7 +753,7 @@ int wlan_cmd_802_11_deauthenticate(wlan_
 
 	/* set AP MAC address */
 	memmove(dauth->MacAddr, Adapter->CurBssParams.bssid,
-		MRVDRV_ETH_ADDR_LEN);
+		ETH_ALEN);
 
 	/* Reason code 3 = Station is leaving */
 #define REASON_CODE_STA_LEAVING 3
@@ -860,7 +860,7 @@ int wlan_cmd_802_11_associate(wlan_priva
 		goto done;
 	}
 
-	rates->Header.Len = MIN(strlen(rates->Rates), WLAN_SUPPORTED_RATES);
+	rates->Header.Len = min(strlen(rates->Rates), WLAN_SUPPORTED_RATES);
 	Adapter->CurBssParams.NumOfRates = rates->Header.Len;
 
 	pos += sizeof(rates->Header) + rates->Header.Len;
@@ -884,7 +884,7 @@ int wlan_cmd_802_11_associate(wlan_priva
 
 	/* Copy the infra. association rates into Current BSS state structure */
 	memcpy(&Adapter->CurBssParams.DataRates, &rates->Rates,
-	       MIN(sizeof(Adapter->CurBssParams.DataRates), rates->Header.Len));
+	       min(sizeof(Adapter->CurBssParams.DataRates), rates->Header.Len));
 
 	PRINTM(INFO, "ASSOC_CMD: rates->Header.Len = %d\n", rates->Header.Len);
 
@@ -1032,12 +1032,12 @@ #define AD_HOC_CAP_PRIVACY_ON 1
 
 	memset(adhs->DataRate, 0, sizeof(adhs->DataRate));
 
-	if (Adapter->adhoc_grate_enabled == TRUE) {
+	if (Adapter->adhoc_grate_enabled) {
 		memcpy(adhs->DataRate, AdhocRates_G,
-		       MIN(sizeof(adhs->DataRate), sizeof(AdhocRates_G)));
+		       min(sizeof(adhs->DataRate), sizeof(AdhocRates_G)));
 	} else {
 		memcpy(adhs->DataRate, AdhocRates_B,
-		       MIN(sizeof(adhs->DataRate), sizeof(AdhocRates_B)));
+		       min(sizeof(adhs->DataRate), sizeof(AdhocRates_B)));
 	}
 
 	/* Find the last non zero */
@@ -1126,7 +1126,7 @@ int wlan_cmd_802_11_ad_hoc_join(wlan_pri
 	pAdHocJoin->BssDescriptor.BeaconPeriod = pBSSDesc->BeaconPeriod;
 
 	memcpy(&pAdHocJoin->BssDescriptor.BSSID,
-	       &pBSSDesc->MacAddress, MRVDRV_ETH_ADDR_LEN);
+	       &pBSSDesc->MacAddress, ETH_ALEN);
 
 	memcpy(&pAdHocJoin->BssDescriptor.SSID,
 	       &pBSSDesc->Ssid.Ssid, pBSSDesc->Ssid.SsidLength);
@@ -1171,7 +1171,7 @@ int wlan_cmd_802_11_ad_hoc_join(wlan_pri
 	memset(pAdHocJoin->BssDescriptor.DataRates, 0,
 	       sizeof(pAdHocJoin->BssDescriptor.DataRates));
 	memcpy(pAdHocJoin->BssDescriptor.DataRates, pBSSDesc->DataRates,
-	       MIN(sizeof(pAdHocJoin->BssDescriptor.DataRates),
+	       min(sizeof(pAdHocJoin->BssDescriptor.DataRates),
 		   sizeof(pBSSDesc->DataRates)));
 
 	card_rates = SupportedRates;
@@ -1309,7 +1309,7 @@ int wlan_ret_802_11_associate(wlan_priva
 
 	/* Set the new BSSID (AP's MAC address) to current BSSID */
 	memcpy(Adapter->CurBssParams.bssid,
-	       pBSSDesc->MacAddress, MRVDRV_ETH_ADDR_LEN);
+	       pBSSDesc->MacAddress, ETH_ALEN);
 
 	/* Make a copy of current BSSID descriptor */
 	memcpy(&Adapter->CurBssParams.BSSDescriptor,
@@ -1321,7 +1321,7 @@ int wlan_ret_802_11_associate(wlan_priva
 	Adapter->MediaConnectStatus = WlanMediaStateConnected;
 
 	if (Adapter->SecInfo.WPAEnabled || Adapter->SecInfo.WPA2Enabled)
-		Adapter->IsGTK_SET = FALSE;
+		Adapter->IsGTK_SET = 0;
 
 	Adapter->SNR[TYPE_RXPD][TYPE_AVG] = 0;
 	Adapter->NF[TYPE_RXPD][TYPE_AVG] = 0;
@@ -1405,7 +1405,7 @@ int wlan_ret_802_11_ad_hoc_start(wlan_pr
 		memset(&Adapter->CurBssParams.BSSDescriptor,
 		       0x00, sizeof(Adapter->CurBssParams.BSSDescriptor));
 
-		Adapter->AdHocFailed = TRUE;
+		Adapter->AdHocFailed = 1;
 		LEAVE();
 		return WLAN_STATUS_FAILURE;
 	}
@@ -1421,11 +1421,11 @@ int wlan_ret_802_11_ad_hoc_start(wlan_pr
 	Adapter->LinkSpeed = MRVDRV_LINK_SPEED_11mbps;
 
 	if (Command == HostCmd_RET_802_11_AD_HOC_START) {
-		Adapter->AdHocCreated = TRUE;
+		Adapter->AdHocCreated = 1;
 
 		/* Update the created network descriptor with the new BSSID */
 		memcpy(pBSSDesc->MacAddress,
-		       pAdHocResult->BSSID, MRVDRV_ETH_ADDR_LEN);
+		       pAdHocResult->BSSID, ETH_ALEN);
 	} else {
 
 		/* Make a copy of current BSSID descriptor, only needed for join since
@@ -1437,7 +1437,7 @@ int wlan_ret_802_11_ad_hoc_start(wlan_pr
 
 	/* Set the BSSID from the joined/started descriptor */
 	memcpy(&Adapter->CurBssParams.bssid,
-	       pBSSDesc->MacAddress, MRVDRV_ETH_ADDR_LEN);
+	       pBSSDesc->MacAddress, ETH_ALEN);
 
 	/* Set the new SSID to current SSID */
 	memcpy(&Adapter->CurBssParams.ssid,
@@ -1553,7 +1553,7 @@ int wlan_reassociation_thread(void *data
 		PRINTM(INFO, "Reassoc: Performing Active Scan @ %lu\n",
 		       jiffies);
 
-		SendSpecificSSIDScan(priv, &Adapter->PreviousSSID, TRUE);
+		SendSpecificSSIDScan(priv, &Adapter->PreviousSSID, 1);
 
 		/* Try to find the specific BSSID we were associated to first */
 		i = FindSSIDInList(Adapter,
diff --git a/drivers/net/wireless/libertas/wlan_main.c b/drivers/net/wireless/libertas/wlan_main.c
index ec75ffd..3836340 100644
--- a/drivers/net/wireless/libertas/wlan_main.c
+++ b/drivers/net/wireless/libertas/wlan_main.c
@@ -242,7 +242,7 @@ static int wlan_open(struct net_device *
 		return WLAN_STATUS_FAILURE;
 	}
 
-	priv->open = TRUE;
+	priv->open = 1;
 
 	if (adapter->MediaConnectStatus == WlanMediaStateConnected) {
 		netif_carrier_on(priv->wlan_dev.netdev);
@@ -269,7 +269,7 @@ static int wlan_close(struct net_device 
 	netif_stop_queue(priv->wlan_dev.netdev);
 	netif_carrier_off(priv->wlan_dev.netdev);
 
-	priv->open = FALSE;
+	priv->open = 0;
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -475,7 +475,7 @@ static int wlan_set_mac_address(struct n
 
 	ENTER();
 
-	memset(Adapter->CurrentAddr, 0, MRVDRV_ETH_ADDR_LEN);
+	memset(Adapter->CurrentAddr, 0, ETH_ALEN);
 
 	/* dev->dev_addr is 8 bytes */
 	HEXDUMP("dev->dev_addr:", dev->dev_addr, ETH_ALEN);
@@ -951,7 +951,7 @@ #endif
 	netif_stop_queue(priv->wlan_dev.netdev);
 	netif_carrier_off(priv->wlan_dev.netdev);
 
-	Adapter->SurpriseRemoved = TRUE;
+	Adapter->SurpriseRemoved = 1;
 
 	/* Stop the thread servicing the interrupts */
 	wake_up_interruptible(&priv->MainThread.waitQ);
@@ -1052,7 +1052,7 @@ int wlan_set_regiontable(wlan_private * 
 			       region);
 			return WLAN_STATUS_FAILURE;
 		}
-		Adapter->region_channel[i].Valid = TRUE;
+		Adapter->region_channel[i].Valid = 1;
 		Adapter->region_channel[i].Region = region;
 		Adapter->region_channel[i].Band = band;
 		i++;
diff --git a/drivers/net/wireless/libertas/wlan_rx.c b/drivers/net/wireless/libertas/wlan_rx.c
index 27f2ad6..f9cc379 100644
--- a/drivers/net/wireless/libertas/wlan_rx.c
+++ b/drivers/net/wireless/libertas/wlan_rx.c
@@ -180,7 +180,7 @@ int ProcessRxedPacket(wlan_private * pri
 	ENTER();
 
 	if (priv->adapter->debugmode & MRVDRV_DEBUG_RX_PATH)
-		HEXDUMP("RX packet: ", skb->data, MIN(skb->len, 100));
+		HEXDUMP("RX packet: ", skb->data, min(skb->len, 100));
 
 	if (priv->adapter->linkmode == WLAN_LINKMODE_802_11)
 		return ProcessRxed_802_11_Packet(priv, skb);
@@ -188,7 +188,7 @@ int ProcessRxedPacket(wlan_private * pri
 	pRxPkt = (struct RxPacketHdr *) skb->data;
 	pRxPD = &pRxPkt->rx_pd;
 
-	HEXDUMP("RX Data: Before chop RxPD", skb->data, MIN(skb->len, 100));
+	HEXDUMP("RX Data: Before chop RxPD", skb->data, min(skb->len, 100));
 
 	if (skb->len < (ETH_HLEN + 8 + sizeof(struct RxPD))) {
 		PRINTM(INFO, "RX Error: FRAME RECEIVED WITH BAD LENGTH\n");
@@ -346,7 +346,7 @@ int ProcessRxed_802_11_Packet(wlan_priva
 	pRxPkt = (struct Rx80211PacketHdr *) skb->data;
 	pRxPD = &pRxPkt->rx_pd;
 
-	// HEXDUMP("RX Data: Before chop RxPD", skb->data, MIN(skb->len, 100));
+	// HEXDUMP("RX Data: Before chop RxPD", skb->data, min(skb->len, 100));
 
 	if (skb->len < (ETH_HLEN + 8 + sizeof(struct RxPD))) {
 		PRINTM(INFO, "RX Error: FRAME RECEIVED WITH BAD LENGTH\n");
@@ -395,7 +395,7 @@ int ProcessRxed_802_11_Packet(wlan_priva
 			radiotap_hdr.rx_flags |= IEEE80211_RADIOTAP_F_RX_BADFCS;
 		//memset(radiotap_hdr.pad, 0x11, IEEE80211_RADIOTAP_HDRLEN - 18);
 
-		// HEXDUMP1("RX radiomode packet BEF: ", skb->data, MIN(skb->len, 100));
+		// HEXDUMP1("RX radiomode packet BEF: ", skb->data, min(skb->len, 100));
 
 		/* chop the RxPD */
 		skb_pull(skb, sizeof(struct RxPD));
@@ -414,7 +414,7 @@ int ProcessRxed_802_11_Packet(wlan_priva
 							    RxRadiotapHdr));
 		memcpy(pradiotap_hdr, &radiotap_hdr,
 		       sizeof(struct RxRadiotapHdr));
-		//HEXDUMP1("RX radiomode packet AFT: ", skb->data, MIN(skb->len, 100));
+		//HEXDUMP1("RX radiomode packet AFT: ", skb->data, min(skb->len, 100));
 		break;
 
 	default:
diff --git a/drivers/net/wireless/libertas/wlan_scan.c b/drivers/net/wireless/libertas/wlan_scan.c
index e788616..829bbf8 100644
--- a/drivers/net/wireless/libertas/wlan_scan.c
+++ b/drivers/net/wireless/libertas/wlan_scan.c
@@ -83,7 +83,7 @@ #define MRVDRV_ACTIVE_SCAN_CHAN_TIME   1
 #ifdef DISCARD_BAD_SSID
 #define CHECK_SSID_IS_VALID(x) ssid_valid(&bssidEntry.Ssid)
 #else
-#define CHECK_SSID_IS_VALID(x) TRUE
+#define CHECK_SSID_IS_VALID(x) 1 
 #endif
 
 /**
@@ -248,11 +248,11 @@ static u8 ssid_valid(struct WLAN_802_11_
 
 	for (ssidIdx = 0; ssidIdx < pSsid->SsidLength; ssidIdx++) {
 		if (!isprint(pSsid->Ssid[ssidIdx])) {
-			return FALSE;
+			return 0;
 		}
 	}
 
-	return TRUE;
+	return 1;
 }
 
 /**
@@ -275,7 +275,7 @@ static void wlan_scan_process_results(wl
 	int foundCurrent;
 	int i;
 
-	foundCurrent = FALSE;
+	foundCurrent = 0;
 
 	if (Adapter->MediaConnectStatus == WlanMediaStateConnected) {
 		/* try to find the current BSSID in the new scan list */
@@ -284,8 +284,8 @@ static void wlan_scan_process_results(wl
 				     &Adapter->CurBssParams.ssid) &&
 			    !memcmp(Adapter->CurBssParams.bssid,
 				    Adapter->ScanTable[i].MacAddress,
-				    MRVDRV_ETH_ADDR_LEN)) {
-				foundCurrent = TRUE;
+				    ETH_ALEN)) {
+				foundCurrent = 1;
 			}
 		}
 
@@ -393,20 +393,20 @@ static void wlan_scan_create_channel_lis
 				    wlan_cpu_to_le16
 				    (MRVDRV_PASSIVE_SCAN_CHAN_TIME);
 				scanChanList[chanIdx].ChanScanMode.PassiveScan =
-				    TRUE;
+				    1;
 			} else {
 				scanChanList[chanIdx].MaxScanTime =
 				    wlan_cpu_to_le16
 				    (MRVDRV_ACTIVE_SCAN_CHAN_TIME);
 				scanChanList[chanIdx].ChanScanMode.PassiveScan =
-				    FALSE;
+				    0;
 			}
 
 			scanChanList[chanIdx].ChanNumber = cfp->Channel;
 
 			if (filteredScan) {
 				scanChanList[chanIdx].ChanScanMode.
-				    DisableChanFilt = TRUE;
+				    DisableChanFilt = 1;
 			}
 		}
 	}
@@ -496,13 +496,13 @@ void wlan_scan_setup_scan_config(wlan_pr
 	/* Initialize the scan as un-filtered by firmware, set to TRUE below if
 	 *   a SSID or BSSID filter is sent in the command
 	 */
-	*pFilteredScan = FALSE;
+	*pFilteredScan = 0; 
 
 	/* Initialize the scan as not being only on the current channel.  If
 	 *   the channel list is customized, only contains one channel, and
 	 *   is the active channel, this is set true and data flow is not halted.
 	 */
-	*pScanCurrentOnly = FALSE;
+	*pScanCurrentOnly = 0;
 
 	if (pUserScanIn) {
 
@@ -545,7 +545,7 @@ void wlan_scan_setup_scan_config(wlan_pr
 		if (ssidLen || (memcmp(pScanCfgOut->specificBSSID,
 				       &zeroMac, sizeof(zeroMac)) != 0)) {
 			*pMaxChanPerScan = MRVDRV_MAX_CHANNELS_PER_SCAN;
-			*pFilteredScan = TRUE;
+			*pFilteredScan = 1;
 		}
 	} else {
 		pScanCfgOut->bssType = Adapter->ScanMode;
@@ -593,10 +593,10 @@ void wlan_scan_setup_scan_config(wlan_pr
 
 			if (scanType == HostCmd_SCAN_TYPE_PASSIVE) {
 				(pScanChanList +
-				 chanIdx)->ChanScanMode.PassiveScan = TRUE;
+				 chanIdx)->ChanScanMode.PassiveScan = 1;
 			} else {
 				(pScanChanList +
-				 chanIdx)->ChanScanMode.PassiveScan = FALSE;
+				 chanIdx)->ChanScanMode.PassiveScan = 0;
 			}
 
 			if (pUserScanIn->chanList[chanIdx].scanTime) {
@@ -620,7 +620,7 @@ void wlan_scan_setup_scan_config(wlan_pr
 		if ((chanIdx == 1) && (pUserScanIn->chanList[0].chanNumber
 				       ==
 				       priv->adapter->CurBssParams.channel)) {
-			*pScanCurrentOnly = TRUE;
+			*pScanCurrentOnly = 1;
 			PRINTM(INFO, "Scan: Scanning current channel only");
 		}
 
@@ -692,7 +692,7 @@ static int wlan_scan_channel_list(wlan_p
 		pChanTlvOut->Header.Len = 0;
 		scanBand = pTmpChan->RadioType;
 		pStartChan = pTmpChan;
-		doneEarly = FALSE;
+		doneEarly = 0;
 
 		/* Construct the Channel TLV for the scan command.  Continue to
 		 *  insert channel TLVs until:
@@ -735,7 +735,7 @@ static int wlan_scan_channel_list(wlan_p
 			/* Increment the index to the channel tlv we are constructing */
 			tlvIdx++;
 
-			doneEarly = FALSE;
+			doneEarly = 0;
 
 			/* Stop the loop if the *current* channel is in the 1,6,11 set
 			 *   and we are not filtering on a BSSID or SSID.
@@ -743,7 +743,7 @@ static int wlan_scan_channel_list(wlan_p
 			if (!filteredScan && (pTmpChan->ChanNumber == 1
 					      || pTmpChan->ChanNumber == 6
 					      || pTmpChan->ChanNumber == 11)) {
-				doneEarly = TRUE;
+				doneEarly = 1;
 			}
 
 			/* Increment the tmp pointer to the next channel to be scanned */
@@ -756,7 +756,7 @@ static int wlan_scan_channel_list(wlan_p
 			if (!filteredScan && (pTmpChan->ChanNumber == 1
 					      || pTmpChan->ChanNumber == 6
 					      || pTmpChan->ChanNumber == 11)) {
-				doneEarly = TRUE;
+				doneEarly = 1;
 			}
 		}
 
@@ -807,7 +807,7 @@ static int wlan_scan_networks(wlan_priva
 	memset(scanChanList, 0x00, sizeof(scanChanList));
 	memset(&scanCfgOut, 0x00, sizeof(scanCfgOut));
 
-	keepPreviousScan = FALSE;
+	keepPreviousScan = 0;
 
 	wlan_scan_setup_scan_config(priv,
 				    pUserScanIn,
@@ -821,7 +821,7 @@ static int wlan_scan_networks(wlan_priva
 		keepPreviousScan = pUserScanIn->keepPreviousScan;
 	}
 
-	if (keepPreviousScan == FALSE) {
+	if (!keepPreviousScan) {
 		memset(Adapter->ScanTable, 0x00,
 		       sizeof(struct bss_descriptor) * MRVDRV_MAX_BSSID_LIST);
 		Adapter->NumInScanTable = 0;
@@ -1002,7 +1002,7 @@ static int InterpretBSSDescriptionWithIE
 
 	ENTER();
 
-	foundDataRateIE = FALSE;
+	foundDataRateIE = 0;
 	rateSize = 0;
 	beaconSize = 0;
 
@@ -1034,14 +1034,14 @@ static int InterpretBSSDescriptionWithIE
 	pwpa_supplicant = &pBSSEntry->wpa_supplicant;
 	pwpa2_supplicant = &pBSSEntry->wpa2_supplicant;
 
-	memcpy(pBSSEntry->MacAddress, pCurrentPtr, MRVDRV_ETH_ADDR_LEN);
+	memcpy(pBSSEntry->MacAddress, pCurrentPtr, ETH_ALEN);
 	PRINTM(INFO, "InterpretIE: AP MAC Addr-%x:%x:%x:%x:%x:%x\n",
 	       pBSSEntry->MacAddress[0], pBSSEntry->MacAddress[1],
 	       pBSSEntry->MacAddress[2], pBSSEntry->MacAddress[3],
 	       pBSSEntry->MacAddress[4], pBSSEntry->MacAddress[5]);
 
-	pCurrentPtr += MRVDRV_ETH_ADDR_LEN;
-	bytesLeftForCurrentBeacon -= MRVDRV_ETH_ADDR_LEN;
+	pCurrentPtr += ETH_ALEN;
+	bytesLeftForCurrentBeacon -= ETH_ALEN;
 
 	if (bytesLeftForCurrentBeacon < 12) {
 		PRINTM(INFO, "InterpretIE: Not enough bytes left\n");
@@ -1128,7 +1128,7 @@ static int InterpretBSSDescriptionWithIE
 			memmove(pBSSEntry->SupportedRates, (pCurrentPtr + 2),
 				elemLen);
 			rateSize = elemLen;
-			foundDataRateIE = TRUE;
+			foundDataRateIE = 1;
 			break;
 
 		case EXTRA_IE:
@@ -1233,7 +1233,7 @@ #define IE_ID_LEN_FIELDS_BYTES 2
 
 			if (!memcmp(pIe->oui, oui01, sizeof(oui01))) {
 				pwpa_supplicant->Wpa_ie_len
-				    = MIN(elemLen + IE_ID_LEN_FIELDS_BYTES,
+				    = min(elemLen + IE_ID_LEN_FIELDS_BYTES,
 					  sizeof(pwpa_supplicant->Wpa_ie));
 				memcpy(pwpa_supplicant->Wpa_ie,
 				       pCurrentPtr,
@@ -1245,7 +1245,7 @@ #define IE_ID_LEN_FIELDS_BYTES 2
 		case WPA2_IE:
 			pIe = (struct IE_WPA *)pCurrentPtr;
 			pwpa2_supplicant->Wpa_ie_len
-			    = MIN(elemLen + IE_ID_LEN_FIELDS_BYTES,
+			    = min(elemLen + IE_ID_LEN_FIELDS_BYTES,
 				  sizeof(pwpa2_supplicant->Wpa_ie));
 			memcpy(pwpa2_supplicant->Wpa_ie,
 			       pCurrentPtr, pwpa2_supplicant->Wpa_ie_len);
@@ -1704,7 +1704,7 @@ #define RSSI_DIFF    ((u8)(PERFECT_RSSI 
 			continue;
 		}
 
-		if (ssid_valid(&Adapter->ScanTable[i].Ssid) == FALSE) {
+		if (!ssid_valid(&Adapter->ScanTable[i].Ssid)) {
 			continue;
 		}
 
@@ -2069,7 +2069,7 @@ int wlan_set_user_scan_ioctl(wlan_privat
 
 	if (copy_from_user(&scanReq,
 			   wrq->u.data.pointer,
-			   MIN(wrq->u.data.length, sizeof(scanReq))) != 0) {
+			   min(wrq->u.data.length, sizeof(scanReq))) != 0) {
 		/* copy_from_user failed  */
 		PRINTM(INFO, "SetUserScan: copy from user failed\n");
 		retcode = -EFAULT;
@@ -2340,7 +2340,7 @@ int wlan_extscan_ioctl(wlan_private * pr
 		LEAVE();
 		return -EFAULT;
 	}
-	SendSpecificSSIDScan(priv, &Ext_Scan_SSID, TRUE);
+	SendSpecificSSIDScan(priv, &Ext_Scan_SSID, 1);
 
 	memset(&wrqu, 0, sizeof(union iwreq_data));
 	wireless_send_event(priv->wlan_dev.netdev, SIOCGIWSCAN, &wrqu, NULL);
diff --git a/drivers/net/wireless/libertas/wlan_scan.h b/drivers/net/wireless/libertas/wlan_scan.h
index a6ee332..d967825 100644
--- a/drivers/net/wireless/libertas/wlan_scan.h
+++ b/drivers/net/wireless/libertas/wlan_scan.h
@@ -77,7 +77,7 @@ struct wlan_scan_cmd_config {
     /**
      *  @brief Specific BSSID used to filter scan results in the firmware
      */
-	u8 specificBSSID[MRVDRV_ETH_ADDR_LEN];
+	u8 specificBSSID[ETH_ALEN];
 
     /**
      *  @brief Length of TLVs sent in command starting at tlvBuffer
@@ -146,7 +146,7 @@ struct wlan_ioctl_user_scan_cfg {
     /**
      *  @brief BSSID filter sent in the firmware command to limit the results
      */
-	u8 specificBSSID[MRVDRV_ETH_ADDR_LEN];
+	u8 specificBSSID[ETH_ALEN];
 
     /**
      *  @brief SSID filter sent in the firmware command to limit the results
diff --git a/drivers/net/wireless/libertas/wlan_tx.c b/drivers/net/wireless/libertas/wlan_tx.c
index 0e760bc..9299ed6 100644
--- a/drivers/net/wireless/libertas/wlan_tx.c
+++ b/drivers/net/wireless/libertas/wlan_tx.c
@@ -88,7 +88,7 @@ static int SendSinglePacket(wlan_private
 	ENTER();
 
 	if ((priv->adapter->debugmode & MRVDRV_DEBUG_TX_PATH) != 0)
-		HEXDUMP("TX packet: ", skb->data, MIN(skb->len, 100));
+		HEXDUMP("TX packet: ", skb->data, min(skb->len, 100));
 
 	if (!skb->len || (skb->len > MRVDRV_ETH_TX_PACKET_BUFFER_SIZE)) {
 		PRINTM(INFO, "Tx Error: Bad skb length %d : %d\n",
@@ -102,7 +102,7 @@ static int SendSinglePacket(wlan_private
 	pLocalTxPD->TxPacketLength = skb->len;
 
 	if (Adapter->PSState != PS_STATE_FULL_POWER) {
-		if (TRUE == CheckLastPacketIndication(priv)) {
+		if (CheckLastPacketIndication(priv)) {
 			Adapter->TxLockFlag = 1;
 			pLocalTxPD->PowerMgmt =
 			    MRVDRV_TxPD_POWER_MGMT_LAST_PACKET;
@@ -136,11 +136,9 @@ static int SendSinglePacket(wlan_private
 	}
 	/* copy destination address from 802.3 or 802.11 header */
 	if (priv->adapter->linkmode == WLAN_LINKMODE_802_11)
-		memcpy(pLocalTxPD->TxDestAddrHigh, p802x_hdr + 4,
-		       MRVDRV_ETH_ADDR_LEN);
+		memcpy(pLocalTxPD->TxDestAddrHigh, p802x_hdr + 4, ETH_ALEN);
 	else
-		memcpy(pLocalTxPD->TxDestAddrHigh, p802x_hdr,
-		       MRVDRV_ETH_ADDR_LEN);
+		memcpy(pLocalTxPD->TxDestAddrHigh, p802x_hdr, ETH_ALEN);
 
 	HEXDUMP("TxPD", (u8 *) pLocalTxPD, sizeof(struct TxPD));
 
@@ -234,7 +232,7 @@ int wlan_process_tx(wlan_private * priv,
 
 	ENTER();
 
-	HEXDUMP("TX Data", skb->data, MIN(skb->len, 100));
+	HEXDUMP("TX Data", skb->data, min(skb->len, 100));
 
 	if (priv->wlan_dev.dnld_sent) {
 		PRINTM(MSG, "TX Error: dnld_sent = %d, not sending\n",
@@ -272,7 +270,7 @@ int SendNullPacket(wlan_private * priv, 
 
 	ENTER();
 
-	if (priv->adapter->SurpriseRemoved == TRUE) {
+	if (priv->adapter->SurpriseRemoved) {
 		ret = WLAN_STATUS_FAILURE;
 		goto done;
 	}
@@ -313,7 +311,7 @@ int SendNullPacket(wlan_private * priv, 
 u8 CheckLastPacketIndication(wlan_private * priv)
 {
 	wlan_adapter *Adapter = priv->adapter;
-	u8 ret = FALSE;
+	u8 ret = 0;
 	if (Adapter->sleep_period.period == 0)
 		goto done;
       done:
@@ -345,7 +343,7 @@ void SendTxFeedback(wlan_private * priv)
 
 	if ((Adapter->debugmode & MRVDRV_DEBUG_TX_PATH) != 0)
 		HEXDUMP("TX feedback: ", (u8 *) radiotap_hdr,
-			MIN(Adapter->CurrentTxSkb->len, 100));
+			min(Adapter->CurrentTxSkb->len, 100));
 
 	txfail = (status >> 24);
 
diff --git a/drivers/net/wireless/libertas/wlan_wext.c b/drivers/net/wireless/libertas/wlan_wext.c
index 9b5e4a9..b25001d 100644
--- a/drivers/net/wireless/libertas/wlan_wext.c
+++ b/drivers/net/wireless/libertas/wlan_wext.c
@@ -338,7 +338,7 @@ static int ChangeAdhocChannel(wlan_priva
 		/* Scan for the network, do not save previous results.  Stale
 		 *   scan data will cause us to join a non-existant adhoc network
 		 */
-		SendSpecificSSIDScan(priv, &curAdhocSsid, FALSE);
+		SendSpecificSSIDScan(priv, &curAdhocSsid, 0);
 
 		// find out the BSSID that matches the current SSID 
 		i = FindSSIDInList(Adapter, &curAdhocSsid, NULL,
@@ -789,7 +789,7 @@ static int reassociation_on(wlan_private
 
 	ENTER();
 
-	Adapter->Reassoc_on = TRUE;
+	Adapter->Reassoc_on = 1;
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -809,7 +809,7 @@ static int reassociation_off(wlan_privat
 
 	del_timer(&Adapter->reassoc_timer);
 
-	Adapter->Reassoc_on = FALSE;
+	Adapter->Reassoc_on = 0;
 
 	LEAVE();
 	return WLAN_STATUS_SUCCESS;
@@ -1656,7 +1656,7 @@ static int wlan_get_range(struct net_dev
 	struct chan_freq_power *cfp;
 	u8 rates[WLAN_SUPPORTED_RATES];
 
-	u8 flag = FALSE;
+	u8 flag = 0;
 
 	ENTER();
 
@@ -1669,7 +1669,7 @@ static int wlan_get_range(struct net_dev
 	memset(rates, 0, sizeof(rates));
 	range->num_bitrates = get_active_data_rates(Adapter, rates);
 
-	for (i = 0; i < MIN(range->num_bitrates, IW_MAX_BITRATES) && rates[i];
+	for (i = 0; i < min(range->num_bitrates, IW_MAX_BITRATES) && rates[i];
 	     i++) {
 		range->bitrate[i] = (rates[i] & 0x7f) * 500000;
 	}
@@ -1705,7 +1705,7 @@ static int wlan_get_range(struct net_dev
 			range->freq[range->num_frequency].e = 1;
 			range->num_frequency++;
 		}
-		flag = TRUE;
+		flag = 1;
 	}
 	if (!flag) {
 		for (j = 0; (range->num_frequency < IW_MAX_FREQUENCIES)
@@ -2520,12 +2520,12 @@ static int wlan_hostcmd_ioctl(struct net
 
 	PRINTM(INFO, "HOSTCMD Command: 0x%04x Size: %d SeqNum: %d\n",
 	       pCmdPtr->Command, pCmdPtr->Size, pCmdPtr->SeqNum);
-	HEXDUMP("Command Data", (u8 *) (pCmdPtr), MIN(32, pCmdPtr->Size));
+	HEXDUMP("Command Data", (u8 *) (pCmdPtr), min(32, pCmdPtr->Size));
 	PRINTM(INFO, "Copying data from : (user)0x%p -> 0x%p(driver)\n",
 	       req->ifr_data, pCmdPtr);
 
-	pCmdNode->CmdWaitQWoken = FALSE;
-	QueueCmd(Adapter, pCmdNode, TRUE);
+	pCmdNode->CmdWaitQWoken = 0;
+	QueueCmd(Adapter, pCmdNode, 1);
 	wake_up_interruptible(&priv->MainThread.waitQ);
 
 	if (wait_option & HostCmd_OPTION_WAITFORRSP) {
@@ -2587,7 +2587,7 @@ static int wlan_get_snr(wlan_private * p
 	if (wrq->u.data.length) {
 		if (copy_from_user
 		    (data, wrq->u.data.pointer,
-		     MIN(wrq->u.data.length, 4) * sizeof(int))) {
+		     min(wrq->u.data.length, 4) * sizeof(int))) {
 			PRINTM(INFO, "Copy from user failed\n");
 			return -EFAULT;
 		}
@@ -2848,7 +2848,7 @@ static int wlan_get_adhoc_status_ioctl(w
 	switch (Adapter->InfrastructureMode) {
 	case Wlan802_11IBSS:
 		if (Adapter->MediaConnectStatus == WlanMediaStateConnected) {
-			if (Adapter->AdhocCreate == TRUE)
+			if (Adapter->AdhocCreate)
 				memcpy(&status, "AdhocStarted", sizeof(status));
 			else
 				memcpy(&status, "AdhocJoined", sizeof(status));
@@ -3054,20 +3054,20 @@ static int wlan_setwpaie_ioctl(wlan_priv
 		       Adapter->Wpa_ie[0]);
 		HEXDUMP("Wpa_ie", Adapter->Wpa_ie, Adapter->Wpa_ie_len);
 		if (Adapter->Wpa_ie[0] == WPA_IE)
-			Adapter->SecInfo.WPAEnabled = TRUE;
+			Adapter->SecInfo.WPAEnabled = 1;
 		else if (Adapter->Wpa_ie[0] == WPA2_IE)
-			Adapter->SecInfo.WPA2Enabled = TRUE;
+			Adapter->SecInfo.WPA2Enabled = 1;
 		else {
-			Adapter->SecInfo.WPAEnabled = FALSE;
-			Adapter->SecInfo.WPA2Enabled = FALSE;
+			Adapter->SecInfo.WPAEnabled = 0;
+			Adapter->SecInfo.WPA2Enabled = 0;
 		}
 	} else {
 		memset(Adapter->Wpa_ie, 0, sizeof(Adapter->Wpa_ie));
 		Adapter->Wpa_ie_len = wrq->u.data.length;
 		PRINTM(INFO, "Reset Wpa_ie_len=%d IE=%#x\n",
 		       Adapter->Wpa_ie_len, Adapter->Wpa_ie[0]);
-		Adapter->SecInfo.WPAEnabled = FALSE;
-		Adapter->SecInfo.WPA2Enabled = FALSE;
+		Adapter->SecInfo.WPAEnabled = 0;
+		Adapter->SecInfo.WPA2Enabled = 0;
 	}
 
 	// enable/disable RSN in firmware if WPA is enabled/disabled
@@ -3098,10 +3098,10 @@ static int wlan_subcmd_setprescan_ioctl(
 	PRINTM(INFO, "WLAN_SUBCMD_SET_PRESCAN %d\n", data);
 	switch (data) {
 	case CMD_ENABLED:
-		Adapter->Prescan = TRUE;
+		Adapter->Prescan = 1;
 		break;
 	case CMD_DISABLED:
-		Adapter->Prescan = FALSE;
+		Adapter->Prescan = 0;
 		break;
 	default:
 		break;
@@ -3259,7 +3259,7 @@ static void adjust_mtu(wlan_private * pr
 	if (priv->adapter->radiomode == WLAN_RADIOMODE_RADIOTAP)
 		mtu_increment += max(sizeof(struct TxRadiotapHdr),
 				     sizeof(struct RxRadiotapHdr));
-	priv->wlan_dev.netdev->mtu = MRVDRV_MAXIMUM_ETH_PACKET_SIZE
+	priv->wlan_dev.netdev->mtu = ETH_FRAME_LEN
 	    - sizeof(struct EthII_Hdr)
 	    + mtu_increment;
 }
@@ -3437,7 +3437,7 @@ static int wlan_get_tsf_ioctl(wlan_priva
 	} else {
 		if (copy_to_user(wrq->u.data.pointer,
 				 &tsfVal,
-				 MIN(wrq->u.data.length,
+				 min(wrq->u.data.length,
 				     sizeof(tsfVal))) != 0) {
 
 			PRINTM(INFO, "IOCTL: Get TSF; Copy to user failed\n");
@@ -3675,7 +3675,7 @@ static int wlan_sleep_params_ioctl(wlan_
 	memset(&sp, 0, sizeof(sp));
 
 	if (copy_from_user(&sp, wrq->u.data.pointer,
-			   MIN(sizeof(sp), wrq->u.data.length))) {
+			   min(sizeof(sp), wrq->u.data.length))) {
 		PRINTM(INFO, "Copy from user failed\n");
 		return -EFAULT;
 	}
@@ -3750,7 +3750,7 @@ static int wlan_scan_type_ioctl(wlan_pri
 
 	memset(buf, 0, sizeof(buf));
 
-	if (copy_from_user(buf, wrq->u.data.pointer, MIN(sizeof(buf),
+	if (copy_from_user(buf, wrq->u.data.pointer, min(sizeof(buf),
 							 wrq->u.data.length))) {
 		PRINTM(INFO, "Copy from user failed\n");
 		return -EFAULT;
@@ -3812,7 +3812,7 @@ static int wlan_scan_mode_ioctl(wlan_pri
 
 	memset(buf, 0, sizeof(buf));
 
-	if (copy_from_user(buf, wrq->u.data.pointer, MIN(sizeof(buf),
+	if (copy_from_user(buf, wrq->u.data.pointer, min(sizeof(buf),
 							 wrq->u.data.length))) {
 		PRINTM(INFO, "Copy from user failed\n");
 		return -EFAULT;
@@ -3886,10 +3886,10 @@ static int wlan_do_set_grate_ioctl(wlan_
 	data1 = *((int *)(wrq->u.name + SUBCMD_OFFSET));
 	switch (data1) {
 	case 0:
-		Adapter->adhoc_grate_enabled = FALSE;
+		Adapter->adhoc_grate_enabled = 0;
 		break;
 	case 1:
-		Adapter->adhoc_grate_enabled = TRUE;
+		Adapter->adhoc_grate_enabled = 1;
 		break;
 	case 2:
 		break;
@@ -4102,7 +4102,7 @@ #define MAX_U16_VAL	65535
 		case WLAN_SET_ATIM_WINDOW:
 			Adapter->AtimWindow =
 			    *((int *)(wrq->u.name + SUBCMD_OFFSET));
-			Adapter->AtimWindow = MIN(Adapter->AtimWindow, 50);
+			Adapter->AtimWindow = min(Adapter->AtimWindow, 50);
 			break;
 		case WLANSETBCNAVG:
 			Adapter->bcn_avg_factor =
@@ -4847,7 +4847,7 @@ int wlan_set_rate(struct net_device *dev
 
 	if (vwrq->value == -1) {
 		action = HostCmd_ACT_SET_TX_AUTO;	// Auto
-		Adapter->Is_DataRate_Auto = TRUE;
+		Adapter->Is_DataRate_Auto = 1;
 		Adapter->DataRate = 0;
 	} else {
 		if (vwrq->value % 100000) {
@@ -4874,7 +4874,7 @@ int wlan_set_rate(struct net_device *dev
 
 		Adapter->DataRate = data_rate;
 		action = HostCmd_ACT_SET_TX_FIX_RATE;
-		Adapter->Is_DataRate_Auto = FALSE;
+		Adapter->Is_DataRate_Auto = 0;
 	}
 
 	ret = PrepareAndSendCommand(priv, HostCmd_CMD_802_11_DATA_RATE,
@@ -5161,7 +5161,7 @@ int wlan_get_essid(struct net_device *de
 
 	/* To make the driver backward compatible with WPA supplicant v0.2.4 */
 	if (dwrq->length == 32)	/* check with WPA supplicant buffer size */
-		dwrq->length = MIN(Adapter->CurBssParams.ssid.SsidLength,
+		dwrq->length = min(Adapter->CurBssParams.ssid.SsidLength,
 				   IW_ESSID_MAX_SIZE);
 	else
 		dwrq->length = Adapter->CurBssParams.ssid.SsidLength + 1;
diff --git a/drivers/net/wireless/libertas/wlanconfig/wlanconfig.c b/drivers/net/wireless/libertas/wlanconfig/wlanconfig.c
index 472cede..3fb90be 100644
--- a/drivers/net/wireless/libertas/wlanconfig/wlanconfig.c
+++ b/drivers/net/wireless/libertas/wlanconfig/wlanconfig.c
@@ -90,10 +90,6 @@ #include    "wlan_scan.h"
 #include	"wlan_wext.h"
 #include	"wlanconfig.h"
 
-#ifndef MIN
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#endif /* MIN */
-
 enum COMMANDS {
 	CMD_HOSTCMD,
 	CMD_RDMAC,
@@ -581,7 +577,7 @@ static int wlan_get_hostcmd_data(FILE *f
 			}
 			*pos3 = '\0';
 			memset(buf, 0, len);
-			memmove(buf, pos2, MIN(strlen(pos2),len));
+			memmove(buf, pos2, min(strlen(pos2),len));
 			buf += len;
 		}
 		else if (*pos2 == '\'') {
@@ -1292,7 +1288,7 @@ static int process_setuserscan(int argc,
     char chanScratch[10];
     char* pScratch;
     int tmpIdx;
-	unsigned int mac[MRVDRV_ETH_ADDR_LEN];
+	unsigned int mac[ETH_ALEN];
     int scanTime;
 
     memset(&scanReq, 0x00, sizeof(scanReq));



More information about the libertas-dev mailing list