Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee5b1aad authored by Ali Bahar's avatar Ali Bahar Committed by Greg Kroah-Hartman
Browse files

staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.



In r8712_generate_ie(), HT check is no longer done.
Removed r8712_add_ht_addt_info().
Changes to defragmentation handling, and queue selection.
Get TSSI command.
Added an Ad-Hoc check to is_desired_network()
r8712_ind_disconnect() now checks for Linked state.
r8712_xmit_bh() now schedules an xmit tasklet.

Signed-off-by: default avatarAli Bahar <ali@internetDog.org>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c6dc001f
Loading
Loading
Loading
Loading
+1 −34
Original line number Diff line number Diff line
@@ -170,17 +170,11 @@ static uint r8712_get_rateset_len(u8 *rateset)
	return i;
}

int r8712_generate_ie(struct registry_priv *pregistrypriv,
		      struct _adapter *padapter)
int r8712_generate_ie(struct registry_priv *pregistrypriv)
{
	int sz = 0, rateLen;
	struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
	u8 *ie = pdev_network->IEs;
	struct ieee80211_ht_cap ht_capie;
	struct ieee80211_ht_addt_info ht_addt_info;
	unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	struct qos_priv *pqospriv = &pmlmepriv->qospriv;

	/*timestamp will be inserted by hardware*/
	sz += 8;
@@ -219,33 +213,6 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv,
	/*IBSS Parameter Set*/
	ie = r8712_set_ie(ie, _IBSS_PARA_IE_, 2,
		    (u8 *)&(pdev_network->Configuration.ATIMWindow), &sz);
	if (pregistrypriv->ht_enable == 1) {
		if (pqospriv->qos_option == 0) {
			ie = r8712_set_ie(ie, _VENDOR_SPECIFIC_IE_,
					   _WMM_IE_Length_, WMM_IE, &sz);
			pqospriv->qos_option = 1;
		}
		memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap));
		ht_capie.cap_info = IEEE80211_HT_CAP_SUP_WIDTH |
				    IEEE80211_HT_CAP_SGI_20 |
				    IEEE80211_HT_CAP_SGI_40 |
				    IEEE80211_HT_CAP_TX_STBC |
				    IEEE80211_HT_CAP_MAX_AMSDU |
				    IEEE80211_HT_CAP_DSSSCCK40;
		ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR &
				0x03) | (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
		ie = r8712_set_ie(ie, _HT_CAPABILITY_IE_,
			    sizeof(struct ieee80211_ht_cap),
			    (unsigned char *)&ht_capie, &sz);
		/*add HT info ie*/
		memset(&ht_addt_info, 0,
			sizeof(struct ieee80211_ht_addt_info));
		/*need to add the HT additional IEs*/
		ht_addt_info.control_chan = pregistrypriv->channel;
		ie = r8712_set_ie(ie, _HT_ADD_INFO_IE_,
			    sizeof(struct ieee80211_ht_addt_info),
			    (unsigned char *)&ht_addt_info, &sz);
	}
	return sz;
}

+2 −4
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ struct ieee_ibss_seq {
	u8 mac[ETH_ALEN];
	u16 seq_num;
	u16 frag_num;
	unsigned int packet_time;
	unsigned long packet_time;
	struct list_head list;
};

@@ -669,7 +669,6 @@ struct ieee80211_txb {
#define CRC_LENGTH                 4U

#define MAX_WPA_IE_LEN 128
#define MAX_WPS_IE_LEN 512

#define NETWORK_EMPTY_ESSID (1<<0)
#define NETWORK_HAS_OFDM    (1<<1)
@@ -789,8 +788,7 @@ int r8712_parse_wpa2_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,
int r8712_get_sec_ie(u8 *in_ie, uint in_len, u8 *rsn_ie, u16 *rsn_len,
		     u8 *wpa_ie, u16 *wpa_len);
int r8712_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen);
int r8712_generate_ie(struct registry_priv *pregistrypriv,
		      struct _adapter *padapter);
int r8712_generate_ie(struct registry_priv *pregistrypriv);
uint r8712_is_cckrates_included(u8 *rate);
uint r8712_is_cckratesonly_included(u8 *rate);

+3 −0
Original line number Diff line number Diff line
@@ -286,6 +286,9 @@ static u8 init_default_value(struct _adapter *padapter)
	pxmitpriv->vcs_type = pregistrypriv->vcs_type;
	pxmitpriv->rts_thresh = pregistrypriv->rts_thresh;
	pxmitpriv->frag_len = pregistrypriv->frag_thresh;
	/* mlme_priv */
	/* Maybe someday we should rename this variable to "active_mode"(Jeff)*/
	pmlmepriv->passive_mode = 1; /* 1: active, 0: passive. */
	/*ht_priv*/
	{
		int i;
+13 −11
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ static void update_recvframe_attrib_from_recvstat(struct rx_pkt_attrib *pattrib,
	} else
		pattrib->tcpchk_valid = 0; /* invalid */
	pattrib->mcs_rate = (u8)((le32_to_cpu(prxstat->rxdw3)) & 0x3f);
	pattrib->htc = (u8)((le32_to_cpu(prxstat->rxdw3) >> 6) & 0x1);
	pattrib->htc = (u8)((le32_to_cpu(prxstat->rxdw3) >> 14) & 0x1);
	/*Offset 16*/
	/*Offset 20*/
	/*phy_info*/
@@ -207,7 +207,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
				   struct  __queue *defrag_q)
{
	struct list_head *plist, *phead;
	u8	wlanhdr_offset;
	u8	*data, wlanhdr_offset;
	u8	curfragnum;
	struct recv_frame_hdr *pfhdr, *pnfhdr;
	union recv_frame *prframe, *pnextrframe;
@@ -224,22 +224,25 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
		/*the first fragment number must be 0
		 *free the whole queue*/
		r8712_free_recvframe(prframe, pfree_recv_queue);
		prframe = NULL;
		goto exit;
		r8712_free_recvframe_queue(defrag_q, pfree_recv_queue);
		return NULL;
	}
	plist = get_next(phead);
	curfragnum++;
	plist = get_list_head(defrag_q);
	plist = get_next(plist);
	data = get_recvframe_data(prframe);
	while (end_of_queue_search(phead, plist) == false) {
		pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
		/*check the fragment sequence  (2nd ~n fragment frame) */
		pnfhdr = &pnextrframe->u.hdr;
		curfragnum++;
		/*check the fragment sequence  (2nd ~n fragment frame) */
		if (curfragnum != pnfhdr->attrib.frag_num) {
			/* the fragment number must increase  (after decache)
			 * release the defrag_q & prframe */
			r8712_free_recvframe(prframe, pfree_recv_queue);
			prframe = NULL;
			goto exit;
			r8712_free_recvframe_queue(defrag_q, pfree_recv_queue);
			return NULL;
		}
		curfragnum++;
		/* copy the 2nd~n fragment frame's payload to the first fragment
		 * get the 2nd~last fragment frame's payload */
		wlanhdr_offset = pnfhdr->attrib.hdrlen + pnfhdr->attrib.iv_len;
@@ -252,7 +255,6 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
		pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
		plist = get_next(plist);
	}
exit:
	/* free the defrag_q queue and return the prframe */
	r8712_free_recvframe_queue(defrag_q, pfree_recv_queue);
	return prframe;
@@ -1074,7 +1076,7 @@ static int recvbuf2recvframe(struct _adapter *padapter, struct sk_buff *pskb)
		/* for first fragment packet, driver need allocate 1536 +
		 * drvinfo_sz + RXDESC_SIZE to defrag packet. */
		if ((mf == 1) && (frag == 0))
			alloc_sz = 1658;
			alloc_sz = 1658;/*1658+6=1664, 1664 is 128 alignment.*/
		else
			alloc_sz = tmp_len;
		/* 2 is for IP header 4 bytes alignment in QoS packet case.
+5 −0
Original line number Diff line number Diff line
@@ -29,7 +29,12 @@
#include "osdep_service.h"
#include "drv_types.h"

/* Realtek's v2.6.6 reduced this to 4. However, under heavy network and CPU
 * loads, even 8 receive buffers might not be enough; cutting it to 4 seemed
 * unwise.
 */
#define NR_RECVBUFF (8)

#define NR_PREALLOC_RECV_SKB (8)
#define RXDESC_SIZE	24
#define RXDESC_OFFSET RXDESC_SIZE
Loading