<commit_before>/*	$OpenBSD: if_atureg.h,v 1.15 2004/12/05 12:25:59 dlg Exp $ */
/*
 * Copyright (c) 2003
 *	<NAME> <<EMAIL>>.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by <NAME>.
 * 4. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY <NAME> AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Daan Vreeken OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/* $ATUWI: $Id: if_atureg.h,v 1.15 2004/12/05 12:25:59 dlg Exp $ */

/************ 		driver options 		************/

/*
 * If you want to disable Intersil or RFMD support in the driver, uncomment
 * one of the following line. This will make the driver about 30 KB smaller
 * since the firmware-images will be left out. (Yes, leaving both out saves
 * 60KB, but that leaves you with a driver that doesn't support any devices :)
 */
/* #define ATU_NO_INTERSIL */
/* #define ATU_NO_RFMD */
/* #define ATU_NO_RFMD2958 */
/* #define ATU_NO_RFMD2958_SMC */

#define ATU_CONFIG_NO		1
#define ATU_IFACE_IDX		0

/************ various performance optimizations ************/

/*
 * setting ATU_NO_OPTIMIZATIONS will set all further options to default
 * values...
 *
 * no optimizations	392.78 KB/sec
 * with optimizations	485.64 KB/sec
 * (+/- 23.6% increase)
 *
 * Disclaimer : Most speed tests were done by transferring a large file over
 * FTP with an MTU of 1500. The tests are done on slow (Pentium-133) machines
 * so small changes in driver-overhead would be easilly noticeable. These
 * numbers are different for every other PC, I have just put them here to show
 * in what order of magnitude the differences are.
 */
/* #define ATU_NO_OPTIMIZATIONS */


/* the number of simultaniuously requested RX transfers */
#define ATU_RX_LIST_CNT	1

/*
 * the number of simultaniously started TX transfers
 * my measurements :
 * 1		430.82 KB/sec
 * 2		534.66 KB/sec
 * 3		536.23 KB/sec
 * 4		537.80 KB/sec
 * 6		537.30 KB/sec
 * 8		535.31 KB/sec
 * 16		535.68 KB/sec
 * 128		535.67 KB/sec (before you ask : yes, 128 is silly :)
 * (+/- 24% increase)
 */
#define ATU_TX_LIST_CNT	8

/*
 * Normally, when a packet arrives at the driver (with a call to atu_start)
 * we start up a USB transfer and transfer the packet to the adapter. Then
 * atu_txeof gets called on interrupt and we hand over the mbuf to
 * usb_tx_done. usb_tx_done will queue the mbuf and schedules a net-isr.
 * After the interrupt the scheduler will call the net-isr. There the mbuf
 * is free'd and atu_start is called (if there are packets on the TX queue).
 * This means that on average 2 task-switches are performed for every single
 * packet we transmit. 
 * If we simply NOT call usb_tx_done when a single transfer is done, but wait
 * for the other transfers we started simultaneously to complete, we can save
 * the overhead of the extra task-switching.
 *
 * measurements :
 * off		465.55 KB/sec
 * on		487.57 KB/sec
 * (+/- 4.7% increase)
 */
#define ATU_LAZY_TX_NETISR

/*
 * Minimum number of simultaneous transfers before we start being lazy.
 * Setting this to 0 will make us so lazy we could keep mbuf's around forever
 * (which you do not want)
 */
#define ATU_LAZY_TX_MIN		1

/*
 * Maximum number of queued mbufs before we call usb_tx_done (should never
 * be higher than ATU_TX_LIST_CNT)
 */
#define ATU_LAZY_TX_MAX		8

/*
 * Whether or not we padd usb packets transfered to the adapter. looking at
 * drivers on other platforms there seems to be something magic about the
 * padding.
 * my measurements :
 * on	- 532.55 KB/sec
 * off	- 536.74 KB/sec
 * I don't see the reason why we should padd bytes here. The adapter seems
 * to be transmitting packets just fine without the padding. So the default is
 * to have no padding, but it's at least supplied as an option. This seems to
 * be necessary with newer firmware versions, but I haven't tested that yet.
 */
/* #define ATU_TX_PADDING */

/*
 * ATU_PROFILING isn't a real optimization. it adds s bunch of sysctl
 * variables that count the number of function calls and data transfers we
 * make. with some shell scripts around it you can easilly measure the
 * performance of the driver and see where bottlenecks might be.
 */
/* #define ATU_PROFILING */




/**** NO user configurable options beyond this point ****/


#ifdef ATU_NO_OPTIMIZATIONS
#undef ATU_LAZY_TX_NETISR
#undef ATU_TX_PADDING
#undef ATU_TX_LIST_CNT
#define ATU_TX_LIST_CNT		1
#undef ATU_RX_LIST_CNT
#define ATU_RX_LIST_CNT		1
#endif



/*
 * According to the 802.11 spec (7.1.2) the frame body can be up to 2312 bytes
 */
#define ATU_RX_BUFSZ		(ATU_RX_HDRLEN + \
				 sizeof(struct ieee80211_frame_addr4) + 2312 + 4)
/* BE CAREFULL! should add ATU_TX_PADDING */
#define ATU_TX_BUFSZ		(ATU_TX_HDRLEN + \
				 sizeof(struct ieee80211_frame_addr4) + 2312)

#define ATU_MIN_FRAMELEN	60

/*
 * Sending packets of more than 1500 bytes confuses some access points, so the
 * default MTU is set to 1500 but can be increased up to 2310 bytes using
 * ifconfig
 */
#define ATU_DEFAULT_MTU	1500
#define ATU_MAX_MTU		(2312 - 2)


#define ATU_ENDPT_RX		0x0
#define ATU_ENDPT_TX		0x1
#define ATU_ENDPT_MAX		0x2

#define ATU_TX_TIMEOUT	10000

#define ATU_JOIN_TIMEOUT	2000

#define ATU_MGMT_INTERVAL	1000 * hz / 1000
#define ATU_SCAN_RETRIES	2
#define ATU_JOIN_RETRIES	1
#define ATU_AUTH_RETRIES	3
#define ATU_ASSOC_RETRIES	3
#define ATU_IBSS_RETRIES	0

#define ATU_NO_QUIRK		0x0000
#define ATU_QUIRK_NO_REMAP	0x0001
#define ATU_QUIRK_FW_DELAY	0x0002

#define ATU_DEFAULT_SSID	""
#define ATU_DEFAULT_CHANNEL	10



enum atu_radio_type {
	RadioRFMD = 0,
	RadioRFMD2958,<commit_msg>remove some defines for timeouts that are no longer used thanks to net80211<commit_after>/*	$OpenBSD: if_atureg.h,v 1.16 2004/12/08 21:01:33 dlg Exp $ */
/*
 * Copyright (c) 2003
 *	<NAME> <<EMAIL>>.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by <NAME>.
 * 4. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY <NAME> AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL <NAME> OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/* $ATUWI: $Id: if_atureg.h,v 1.16 2004/12/08 21:01:33 dlg Exp $ */

/************ 		driver options 		************/

/*
 * If you want to disable Intersil or RFMD support in the driver, uncomment
 * one of the following line. This will make the driver about 30 KB smaller
 * since the firmware-images will be left out. (Yes, leaving both out saves
 * 60KB, but that leaves you with a driver that doesn't support any devices :)
 */
/* #define ATU_NO_INTERSIL */
/* #define ATU_NO_RFMD */
/* #define ATU_NO_RFMD2958 */
/* #define ATU_NO_RFMD2958_SMC */

#define ATU_CONFIG_NO		1
#define ATU_IFACE_IDX		0

/************ various performance optimizations ************/

/*
 * setting ATU_NO_OPTIMIZATIONS will set all further options to default
 * values...
 *
 * no optimizations	392.78 KB/sec
 * with optimizations	485.64 KB/sec
 * (+/- 23.6% increase)
 *
 * Disclaimer : Most speed tests were done by transferring a large file over
 * FTP with an MTU of 1500. The tests are done on slow (Pentium-133) machines
 * so small changes in driver-overhead would be easilly noticeable. These
 * numbers are different for every other PC, I have just put them here to show
 * in what order of magnitude the differences are.
 */
/* #define ATU_NO_OPTIMIZATIONS */


/* the number of simultaniuously requested RX transfers */
#define ATU_RX_LIST_CNT	1

/*
 * the number of simultaniously started TX transfers
 * my measurements :
 * 1		430.82 KB/sec
 * 2		534.66 KB/sec
 * 3		536.23 KB/sec
 * 4		537.80 KB/sec
 * 6		537.30 KB/sec
 * 8		535.31 KB/sec
 * 16		535.68 KB/sec
 * 128		535.67 KB/sec (before you ask : yes, 128 is silly :)
 * (+/- 24% increase)
 */
#define ATU_TX_LIST_CNT	8

/*
 * Normally, when a packet arrives at the driver (with a call to atu_start)
 * we start up a USB transfer and transfer the packet to the adapter. Then
 * atu_txeof gets called on interrupt and we hand over the mbuf to
 * usb_tx_done. usb_tx_done will queue the mbuf and schedules a net-isr.
 * After the interrupt the scheduler will call the net-isr. There the mbuf
 * is free'd and atu_start is called (if there are packets on the TX queue).
 * This means that on average 2 task-switches are performed for every single
 * packet we transmit. 
 * If we simply NOT call usb_tx_done when a single transfer is done, but wait
 * for the other transfers we started simultaneously to complete, we can save
 * the overhead of the extra task-switching.
 *
 * measurements :
 * off		465.55 KB/sec
 * on		487.57 KB/sec
 * (+/- 4.7% increase)
 */
#define ATU_LAZY_TX_NETISR

/*
 * Minimum number of simultaneous transfers before we start being lazy.
 * Setting this to 0 will make us so lazy we could keep mbuf's around forever
 * (which you do not want)
 */
#define ATU_LAZY_TX_MIN		1

/*
 * Maximum number of queued mbufs before we call usb_tx_done (should never
 * be higher than ATU_TX_LIST_CNT)
 */
#define ATU_LAZY_TX_MAX		8

/*
 * Whether or not we padd usb packets transfered to the adapter. looking at
 * drivers on other platforms there seems to be something magic about the
 * padding.
 * my measurements :
 * on	- 532.55 KB/sec
 * off	- 536.74 KB/sec
 * I don't see the reason why we should padd bytes here. The adapter seems
 * to be transmitting packets just fine without the padding. So the default is
 * to have no padding, but it's at least supplied as an option. This seems to
 * be necessary with newer firmware versions, but I haven't tested that yet.
 */
/* #define ATU_TX_PADDING */

/*
 * ATU_PROFILING isn't a real optimization. it adds s bunch of sysctl
 * variables that count the number of function calls and data transfers we
 * make. with some shell scripts around it you can easilly measure the
 * performance of the driver and see where bottlenecks might be.
 */
/* #define ATU_PROFILING */




/**** NO user configurable options beyond this point ****/


#ifdef ATU_NO_OPTIMIZATIONS
#undef ATU_LAZY_TX_NETISR
#undef ATU_TX_PADDING
#undef ATU_TX_LIST_CNT
#define ATU_TX_LIST_CNT		1
#undef ATU_RX_LIST_CNT
#define ATU_RX_LIST_CNT		1
#endif



/*
 * According to the 802.11 spec (7.1.2) the frame body can be up to 2312 bytes
 */
#define ATU_RX_BUFSZ		(ATU_RX_HDRLEN + \
				 sizeof(struct ieee80211_frame_addr4) + 2312 + 4)
/* BE CAREFULL! should add ATU_TX_PADDING */
#define ATU_TX_BUFSZ		(ATU_TX_HDRLEN + \
				 sizeof(struct ieee80211_frame_addr4) + 2312)

#define ATU_MIN_FRAMELEN	60

/*
 * Sending packets of more than 1500 bytes confuses some access points, so the
 * default MTU is set to 1500 but can be increased up to 2310 bytes using
 * ifconfig
 */
#define ATU_DEFAULT_MTU	1500
#define ATU_MAX_MTU		(2312 - 2)


#define ATU_ENDPT_RX		0x0
#define ATU_ENDPT_TX		0x1
#define ATU_ENDPT_MAX		0x2

#define ATU_TX_TIMEOUT		10000
#define ATU_JOIN_TIMEOUT	2000

#define ATU_NO_QUIRK		0x0000
#define ATU_QUIRK_NO_REMAP	0x0001
#define ATU_QUIRK_FW_DELAY	0x0002

#define ATU_DEFAULT_SSID	""
#define ATU_DEFAULT_CHANNEL	10



enum atu_radio_type {
	RadioRFMD = 0,
	RadioRFMD2958,
{'fraction_non_alphanumeric': 0.07528122295933083, 'fraction_numerical': 0.03807326218632824, 'mean_word_length': 3.7594371997254634, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7443942', 'n_tokens_mistral': 4917, 'n_tokens_neox': 4324, 'n_words': 1872}