Commit e38f734a authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging driver updates from Greg KH:
 "Here is the "big" set of staging driver changes for 6.8-rc1. It's not
  really that big this release cycle, not much happened except for 186
  patches of coding style cleanups. The majority was in the rtl8192e
  driver, but there are other smaller changes in a few other staging
  drivers, full details in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (186 commits)
  Staging: rtl8192e: Rename variable OpMode
  Staging: rtl8192e: Rename variable bIsAggregateFrame
  Staging: rtl8192e: Rename function rtllib_EnableNetMonitorMode()
  Staging: rtl8192e: Rename variable NumRxOkInPeriod
  Staging: rtl8192e: Rename variable NumTxOkInPeriod
  Staging: rtl8192e: Rename variable bUsed
  staging: vme_user: print more detailed infomation when an error occurs
  Staging: rtl8192e: Rename function rtllib_DisableNetMonitorMode()
  Staging: rtl8192e: Rename variable bInitState
  Staging: rtl8192e: Rename variable skb_waitQ
  Staging: rtl8192e: Rename variable BasicRate
  Staging: rtl8192e: Rename variable QueryRate
  Staging: rtl8192e: Rename function rtllib_TURBO_Info()
  Staging: rtl8192e: Rename function rtllib_WMM_Info()
  Staging: rtl8192e: Rename function rtllib_MFIE_Grate()
  Staging: rtl8192e: Rename function rtllib_MFIE_Brate()
  Staging: rtl8192e: Fixup statement broken across 2 lines in rtllib_softmac_new_net()
  Staging: rtl8192e: Fixup statement broken across 2 lines in rtllib_softmac_xmit()
  Staging: rtl8192e: Fix function definition broken across multiple lines
  Staging: rtl8192e: Fix statement broken across 2 lines in rtllib_rx_assoc_resp()
  ...
parents 80955ae9 0a46c21c
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -3950,6 +3950,10 @@ S: 21513 Conradia Ct
S: Cupertino, CA 95014
S: USA

N: Manohar Vanga
E: manohar.vanga@gmail.com
D: VME subsystem maintainer

N: Thibaut Varène
E: hacks+kernel@slashdirt.org
W: http://hacks.slashdirt.org/
@@ -4050,6 +4054,10 @@ D: Fixes for the NE/2-driver
D: Miscellaneous MCA-support
D: Cleanup of the Config-files

N: Martyn Welch
E: martyn@welchs.me.uk
D: VME subsystem maintainer

N: Matt Welsh
E: mdw@metalab.unc.edu
W: http://www.cs.berkeley.edu/~mdw
+1 −4
Original line number Diff line number Diff line
@@ -23407,11 +23407,8 @@ F: include/linux/vmalloc.h
F:	mm/vmalloc.c
VME SUBSYSTEM
M:	Martyn Welch <martyn@welchs.me.uk>
M:	Manohar Vanga <manohar.vanga@gmail.com>
M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
L:	linux-kernel@vger.kernel.org
S:	Odd fixes
S:	Orphan
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
F:	Documentation/driver-api/vme.rst
F:	drivers/staging/vme_user/
+0 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
rtllib-objs :=			\
	dot11d.o		\
	rtllib_module.o		\
	rtllib_rx.o		\
	rtllib_tx.o		\

drivers/staging/rtl8192e/dot11d.c

deleted100644 → 0
+0 −165
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0
/******************************************************************************
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 *
 * Contact Information:
 * wlanfae <wlanfae@realtek.com>
 ******************************************************************************/
#include "dot11d.h"

struct channel_list {
	u8      channel[32];
	u8      len;
};

static struct channel_list channel_array[] = {
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 36, 40, 44, 48, 52, 56, 60, 64,
	  149, 153, 157, 161, 165}, 24},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52, 56,
	  60, 64}, 21},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52,
	  56, 60, 64}, 22},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52,
	  56, 60, 64}, 22},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52,
	  56, 60, 64}, 22},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 36, 40, 44, 48, 52,
	 56, 60, 64}, 22},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, 14},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13},
	{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 36, 40, 44, 48, 52,
	  56, 60, 64}, 21}
};

void dot11d_init(struct rtllib_device *ieee)
{
	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);

	dot11d_info->enabled = false;

	dot11d_info->state = DOT11D_STATE_NONE;
	dot11d_info->country_len = 0;
	memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
	memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
	RESET_CIE_WATCHDOG(ieee);
}
EXPORT_SYMBOL(dot11d_init);

void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee)
{
	int i, max_chan = 14, min_chan = 1;

	ieee->global_domain = false;

	if (channel_array[channel_plan].len != 0) {
		memset(GET_DOT11D_INFO(ieee)->channel_map, 0,
		       sizeof(GET_DOT11D_INFO(ieee)->channel_map));
		for (i = 0; i < channel_array[channel_plan].len; i++) {
			if (channel_array[channel_plan].channel[i] < min_chan ||
			    channel_array[channel_plan].channel[i] > max_chan)
				break;
			GET_DOT11D_INFO(ieee)->channel_map[channel_array
					[channel_plan].channel[i]] = 1;
		}
	}

	switch (channel_plan) {
	case COUNTRY_CODE_GLOBAL_DOMAIN:
		ieee->global_domain = true;
		for (i = 12; i <= 14; i++)
			GET_DOT11D_INFO(ieee)->channel_map[i] = 2;
		ieee->bss_start_channel = 10;
		break;

	case COUNTRY_CODE_WORLD_WIDE_13:
		for (i = 12; i <= 13; i++)
			GET_DOT11D_INFO(ieee)->channel_map[i] = 2;
		ieee->bss_start_channel = 10;
		break;

	default:
		ieee->bss_start_channel = 1;
		break;
	}
}
EXPORT_SYMBOL(dot11d_channel_map);

void dot11d_reset(struct rtllib_device *ieee)
{
	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
	u32 i;

	memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
	memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
	for (i = 1; i <= 11; i++)
		(dot11d_info->channel_map)[i] = 1;
	for (i = 12; i <= 14; i++)
		(dot11d_info->channel_map)[i] = 2;
	dot11d_info->state = DOT11D_STATE_NONE;
	dot11d_info->country_len = 0;
	RESET_CIE_WATCHDOG(ieee);
}

void dot11d_update_country(struct rtllib_device *dev, u8 *address,
			   u16 country_len, u8 *country)
{
	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
	u8 i, j, number_of_triples, max_channel_number;
	struct chnl_txpow_triple *triple;

	memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
	memset(dot11d_info->max_tx_power_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
	max_channel_number = 0;
	number_of_triples = (country_len - 3) / 3;
	triple = (struct chnl_txpow_triple *)(country + 3);
	for (i = 0; i < number_of_triples; i++) {
		if (max_channel_number >= triple->first_channel) {
			netdev_info(dev->dev,
				    "%s: Invalid country IE, skip it......1\n",
				    __func__);
			return;
		}
		if (MAX_CHANNEL_NUMBER < (triple->first_channel +
		    triple->num_channels)) {
			netdev_info(dev->dev,
				    "%s: Invalid country IE, skip it......2\n",
				    __func__);
			return;
		}

		for (j = 0; j < triple->num_channels; j++) {
			dot11d_info->channel_map[triple->first_channel + j] = 1;
			dot11d_info->max_tx_power_list[triple->first_channel + j] =
						 triple->max_tx_power;
			max_channel_number = triple->first_channel + j;
		}

		triple = (struct chnl_txpow_triple *)((u8 *)triple + 3);
	}

	UPDATE_CIE_SRC(dev, address);

	dot11d_info->country_len = country_len;
	memcpy(dot11d_info->country_buffer, country, country_len);
	dot11d_info->state = DOT11D_STATE_LEARNED;
}

void dot11d_scan_complete(struct rtllib_device *dev)
{
	struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);

	switch (dot11d_info->state) {
	case DOT11D_STATE_LEARNED:
		dot11d_info->state = DOT11D_STATE_DONE;
		break;
	case DOT11D_STATE_DONE:
		dot11d_reset(dev);
		break;
	case DOT11D_STATE_NONE:
		break;
	}
}

drivers/staging/rtl8192e/dot11d.h

deleted100644 → 0
+0 −84
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
/******************************************************************************
 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
 *
 * Contact Information:
 * wlanfae <wlanfae@realtek.com>
 ******************************************************************************/
#ifndef __INC_DOT11D_H
#define __INC_DOT11D_H

#include "rtllib.h"

struct chnl_txpow_triple {
	u8 first_channel;
	u8  num_channels;
	u8  max_tx_power;
};

enum dot11d_state {
	DOT11D_STATE_NONE = 0,
	DOT11D_STATE_LEARNED,
	DOT11D_STATE_DONE,
};

/**
 * struct rt_dot11d_info * @country_len: value greater than 0 if
 *		  @country_buffer contains valid country information element.
 * @channel_map: holds channel values
 *		0 - invalid,
 *		1 - valid (active scan),
 *		2 - valid (passive scan)
 * @country_src_addr - Source AP of the country IE
 */

struct rt_dot11d_info {
	bool enabled;

	u16 country_len;
	u8  country_buffer[MAX_IE_LEN];
	u8  country_src_addr[6];
	u8  country_watchdog;

	u8  channel_map[MAX_CHANNEL_NUMBER + 1];
	u8  max_tx_power_list[MAX_CHANNEL_NUMBER + 1];

	enum dot11d_state state;
};

static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
{
	memcpy(des, src, 6);
}

#define GET_DOT11D_INFO(__ieee_dev)			\
	 ((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))

#define IS_DOT11D_ENABLE(__ieee_dev)			\
	 (GET_DOT11D_INFO(__ieee_dev)->enabled)
#define IS_COUNTRY_IE_VALID(__ieee_dev)			\
	(GET_DOT11D_INFO(__ieee_dev)->country_len > 0)

#define IS_EQUAL_CIE_SRC(__ieee_dev, __address)		\
	 ether_addr_equal_unaligned( \
		GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
#define UPDATE_CIE_SRC(__ieee_dev, __address)		\
	copy_mac_addr(GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)

#define GET_CIE_WATCHDOG(__ieee_dev)				\
	 (GET_DOT11D_INFO(__ieee_dev)->country_watchdog)
static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
{
	GET_CIE_WATCHDOG(__ieee_dev) = 0;
}

#define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev))

void dot11d_init(struct rtllib_device *dev);
void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee);
void dot11d_reset(struct rtllib_device *dev);
void dot11d_update_country(struct rtllib_device *dev, u8 *address,
			   u16 country_len, u8 *country);
void dot11d_scan_complete(struct rtllib_device *dev);

#endif
Loading