mirror of
https://github.com/armbian/linux-cix.git
synced 2026-01-06 12:30:45 -08:00
Merge tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH: "Here is the large set of staging driver changes for 6.2-rc1. Another round of cleanups for staging drivers with no big additions. Overall more lines were removed than added, always a nice sign, with nothing happening in here other than general coding style cleanups and minor fixes in the drivers. Full, boring, details are in the shortlog. All of these have been in linux-next for a while with no reported problems" * tag 'staging-6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (253 commits) vme: Use root_device_register() not underlined version staging: rtl8192e: Fix spelling mistake "ContryIE" -> "CountryIE" vme: Fix error not catched in fake_init() staging: vme_user: remove multiple blank lines staging: r8188eu: use subtype helper in rtw_check_bcn_info staging: r8188eu: use subtype helpers in collect_bss_info staging: r8188eu: remove unused da parameter staging: r8188eu: merge two probereq_p2p functions staging: r8188eu: simplify err handling for unknown station staging: r8188eu: handle the non-ap case first staging: r8188eu: move bBusyTraffic update staging: r8188eu: read reason code from ieee80211_mgmt staging: r8188eu: use ieee80211_mgmt to parse addresses staging: r8188eu: remove a variable staging: r8188eu: simplify error handling for missing station staging: r8188eu: stop beacon processing if kmalloc fails staging: r8188eu: exit if beacon is not from our bss staging: r8188eu: simplify update_sta_support_rate params staging: r8188eu: use ie buffer in update_beacon_info staging: r8188eu: pass only ies to process_p2p_ps_ie ...
This commit is contained in:
@@ -154,13 +154,13 @@ static inline uint64_t cvmx_build_bits(uint64_t high_bit,
|
||||
|
||||
/**
|
||||
* Convert a memory pointer (void*) into a hardware compatible
|
||||
* memory address (uint64_t). Octeon hardware widgets don't
|
||||
* memory address (phys_addr_t). Octeon hardware widgets don't
|
||||
* understand logical addresses.
|
||||
*
|
||||
* @ptr: C style memory pointer
|
||||
* Returns Hardware physical address
|
||||
*/
|
||||
static inline uint64_t cvmx_ptr_to_phys(void *ptr)
|
||||
static inline phys_addr_t cvmx_ptr_to_phys(void *ptr)
|
||||
{
|
||||
if (sizeof(void *) == 8) {
|
||||
/*
|
||||
|
||||
@@ -1004,10 +1004,7 @@ static int _nbu2ss_in_dma(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep,
|
||||
/* MAX Packet Size */
|
||||
mpkt = _nbu2ss_readl(&preg->EP_REGS[num].EP_PCKT_ADRS) & EPN_MPKT;
|
||||
|
||||
if ((DMA_MAX_COUNT * mpkt) < length)
|
||||
i_write_length = DMA_MAX_COUNT * mpkt;
|
||||
else
|
||||
i_write_length = length;
|
||||
i_write_length = min(DMA_MAX_COUNT * mpkt, length);
|
||||
|
||||
/*------------------------------------------------------------*/
|
||||
/* Number of transmission packets */
|
||||
|
||||
@@ -28,7 +28,7 @@ static ssize_t online_show(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct fieldbus_dev *fb = dev_get_drvdata(dev);
|
||||
|
||||
return sprintf(buf, "%d\n", !!fb->online);
|
||||
return sysfs_emit(buf, "%d\n", !!fb->online);
|
||||
}
|
||||
static DEVICE_ATTR_RO(online);
|
||||
|
||||
@@ -39,7 +39,7 @@ static ssize_t enabled_show(struct device *dev, struct device_attribute *attr,
|
||||
|
||||
if (!fb->enable_get)
|
||||
return -EINVAL;
|
||||
return sprintf(buf, "%d\n", !!fb->enable_get(fb));
|
||||
return sysfs_emit(buf, "%d\n", !!fb->enable_get(fb));
|
||||
}
|
||||
|
||||
static ssize_t enabled_store(struct device *dev, struct device_attribute *attr,
|
||||
@@ -66,11 +66,8 @@ static ssize_t card_name_show(struct device *dev, struct device_attribute *attr,
|
||||
{
|
||||
struct fieldbus_dev *fb = dev_get_drvdata(dev);
|
||||
|
||||
/*
|
||||
* card_name was provided by child driver, could potentially be long.
|
||||
* protect against buffer overrun.
|
||||
*/
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", fb->card_name);
|
||||
/* card_name was provided by child driver. */
|
||||
return sysfs_emit(buf, "%s\n", fb->card_name);
|
||||
}
|
||||
static DEVICE_ATTR_RO(card_name);
|
||||
|
||||
@@ -79,7 +76,7 @@ static ssize_t read_area_size_show(struct device *dev,
|
||||
{
|
||||
struct fieldbus_dev *fb = dev_get_drvdata(dev);
|
||||
|
||||
return sprintf(buf, "%zu\n", fb->read_area_sz);
|
||||
return sysfs_emit(buf, "%zu\n", fb->read_area_sz);
|
||||
}
|
||||
static DEVICE_ATTR_RO(read_area_size);
|
||||
|
||||
@@ -88,7 +85,7 @@ static ssize_t write_area_size_show(struct device *dev,
|
||||
{
|
||||
struct fieldbus_dev *fb = dev_get_drvdata(dev);
|
||||
|
||||
return sprintf(buf, "%zu\n", fb->write_area_sz);
|
||||
return sysfs_emit(buf, "%zu\n", fb->write_area_sz);
|
||||
}
|
||||
static DEVICE_ATTR_RO(write_area_size);
|
||||
|
||||
@@ -116,7 +113,7 @@ static ssize_t fieldbus_type_show(struct device *dev,
|
||||
break;
|
||||
}
|
||||
|
||||
return sprintf(buf, "%s\n", t);
|
||||
return sysfs_emit(buf, "%s\n", t);
|
||||
}
|
||||
static DEVICE_ATTR_RO(fieldbus_type);
|
||||
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
|
||||
#define MUX_TX_MAX_SIZE 2048
|
||||
|
||||
#define GDM_TTY_READY(gdm) (gdm && gdm->tty_dev && gdm->port.count)
|
||||
static inline bool gdm_tty_ready(struct gdm *gdm)
|
||||
{
|
||||
return gdm && gdm->tty_dev && gdm->port.count;
|
||||
}
|
||||
|
||||
static struct tty_driver *gdm_driver[TTY_MAX_COUNT];
|
||||
static struct gdm *gdm_table[TTY_MAX_COUNT][GDM_TTY_MINOR];
|
||||
@@ -113,7 +116,7 @@ static int gdm_tty_recv_complete(void *data,
|
||||
{
|
||||
struct gdm *gdm = tty_dev->gdm[index];
|
||||
|
||||
if (!GDM_TTY_READY(gdm)) {
|
||||
if (!gdm_tty_ready(gdm)) {
|
||||
if (complete == RECV_PACKET_PROCESS_COMPLETE)
|
||||
gdm->tty_dev->recv_func(gdm->tty_dev->priv_dev,
|
||||
gdm_tty_recv_complete);
|
||||
@@ -140,7 +143,7 @@ static void gdm_tty_send_complete(void *arg)
|
||||
{
|
||||
struct gdm *gdm = arg;
|
||||
|
||||
if (!GDM_TTY_READY(gdm))
|
||||
if (!gdm_tty_ready(gdm))
|
||||
return;
|
||||
|
||||
tty_port_tty_wakeup(&gdm->port);
|
||||
@@ -154,7 +157,7 @@ static int gdm_tty_write(struct tty_struct *tty, const unsigned char *buf,
|
||||
int sent_len = 0;
|
||||
int sending_len = 0;
|
||||
|
||||
if (!GDM_TTY_READY(gdm))
|
||||
if (!gdm_tty_ready(gdm))
|
||||
return -ENODEV;
|
||||
|
||||
if (!len)
|
||||
@@ -181,7 +184,7 @@ static unsigned int gdm_tty_write_room(struct tty_struct *tty)
|
||||
{
|
||||
struct gdm *gdm = tty->driver_data;
|
||||
|
||||
if (!GDM_TTY_READY(gdm))
|
||||
if (!gdm_tty_ready(gdm))
|
||||
return 0;
|
||||
|
||||
return WRITE_SIZE;
|
||||
|
||||
@@ -239,7 +239,6 @@ static void show_loopback_devices(struct loopback_test *t)
|
||||
|
||||
for (i = 0; i < t->device_count; i++)
|
||||
printf("device[%d] = %s\n", i, t->devices[i].name);
|
||||
|
||||
}
|
||||
|
||||
int open_sysfs(const char *sys_pfx, const char *node, int flags)
|
||||
@@ -274,7 +273,6 @@ float read_sysfs_float_fd(int fd, const char *sys_pfx, const char *node)
|
||||
char buf[SYSFS_MAX_INT];
|
||||
|
||||
if (read(fd, buf, sizeof(buf)) < 0) {
|
||||
|
||||
fprintf(stderr, "unable to read from %s%s %s\n", sys_pfx, node,
|
||||
strerror(errno));
|
||||
close(fd);
|
||||
@@ -367,7 +365,6 @@ static int get_results(struct loopback_test *t)
|
||||
r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
|
||||
r->gbphy_firmware_latency_jitter =
|
||||
r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
|
||||
|
||||
}
|
||||
|
||||
/*calculate the aggregate results of all enabled devices */
|
||||
@@ -407,7 +404,6 @@ static int get_results(struct loopback_test *t)
|
||||
r->apbridge_unipro_latency_max - r->apbridge_unipro_latency_min;
|
||||
r->gbphy_firmware_latency_jitter =
|
||||
r->gbphy_firmware_latency_max - r->gbphy_firmware_latency_min;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -536,7 +532,6 @@ static int log_results(struct loopback_test *t)
|
||||
fprintf(stderr, "unable to open %s for appending\n", file_name);
|
||||
abort();
|
||||
}
|
||||
|
||||
}
|
||||
for (i = 0; i < t->device_count; i++) {
|
||||
if (!device_enabled(t, i))
|
||||
@@ -550,10 +545,8 @@ static int log_results(struct loopback_test *t)
|
||||
if (ret == -1)
|
||||
fprintf(stderr, "unable to write %d bytes to csv.\n", len);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (t->aggregate_output) {
|
||||
len = format_output(t, &t->aggregate_results, "aggregate",
|
||||
data, sizeof(data), &tm);
|
||||
@@ -675,6 +668,7 @@ err:
|
||||
static int close_poll_files(struct loopback_test *t)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < t->poll_count; i++)
|
||||
close(t->fds[i].fd);
|
||||
|
||||
@@ -740,7 +734,6 @@ static int wait_for_complete(struct loopback_test *t)
|
||||
ts = &t->poll_timeout;
|
||||
|
||||
while (1) {
|
||||
|
||||
ret = ppoll(t->fds, t->poll_count, ts, &mask_old);
|
||||
if (ret <= 0) {
|
||||
stop_tests(t);
|
||||
@@ -780,7 +773,6 @@ static void prepare_devices(struct loopback_test *t)
|
||||
if (t->stop_all || device_enabled(t, i))
|
||||
write_sysfs_val(t->devices[i].sysfs_entry, "type", 0);
|
||||
|
||||
|
||||
for (i = 0; i < t->device_count; i++) {
|
||||
if (!device_enabled(t, i))
|
||||
continue;
|
||||
@@ -823,7 +815,6 @@ static int start(struct loopback_test *t)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void loopback_run(struct loopback_test *t)
|
||||
{
|
||||
int i;
|
||||
@@ -852,7 +843,6 @@ void loopback_run(struct loopback_test *t)
|
||||
if (ret)
|
||||
goto err;
|
||||
|
||||
|
||||
get_results(t);
|
||||
|
||||
log_results(t);
|
||||
@@ -861,7 +851,6 @@ void loopback_run(struct loopback_test *t)
|
||||
|
||||
err:
|
||||
printf("Error running test\n");
|
||||
return;
|
||||
}
|
||||
|
||||
static int sanity_check(struct loopback_test *t)
|
||||
@@ -881,10 +870,8 @@ static int sanity_check(struct loopback_test *t)
|
||||
fprintf(stderr, "Bad device mask %x\n", (1 << i));
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -331,11 +331,9 @@ static IIO_DEV_ATTR_PHASE(0, 1, 0200, NULL, ad9834_write, AD9834_REG_PHASE1);
|
||||
static IIO_DEV_ATTR_PHASESYMBOL(0, 0200, NULL, ad9834_write, AD9834_PSEL);
|
||||
static IIO_CONST_ATTR_PHASE_SCALE(0, "0.0015339808"); /* 2PI/2^12 rad*/
|
||||
|
||||
static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL,
|
||||
ad9834_write, AD9834_PIN_SW);
|
||||
static IIO_DEV_ATTR_PINCONTROL_EN(0, 0200, NULL, ad9834_write, AD9834_PIN_SW);
|
||||
static IIO_DEV_ATTR_OUT_ENABLE(0, 0200, NULL, ad9834_write, AD9834_RESET);
|
||||
static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL,
|
||||
ad9834_write, AD9834_OPBITEN);
|
||||
static IIO_DEV_ATTR_OUTY_ENABLE(0, 1, 0200, NULL, ad9834_write, AD9834_OPBITEN);
|
||||
static IIO_DEV_ATTR_OUT_WAVETYPE(0, 0, ad9834_store_wavetype, 0);
|
||||
static IIO_DEV_ATTR_OUT_WAVETYPE(0, 1, ad9834_store_wavetype, 1);
|
||||
|
||||
|
||||
@@ -109,8 +109,7 @@ unlock:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ade7854_i2c_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
static int ade7854_i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct ade7854_state *st;
|
||||
struct iio_dev *indio_dev;
|
||||
@@ -141,7 +140,7 @@ static struct i2c_driver ade7854_i2c_driver = {
|
||||
.driver = {
|
||||
.name = "ade7854",
|
||||
},
|
||||
.probe = ade7854_i2c_probe,
|
||||
.probe_new = ade7854_i2c_probe,
|
||||
.id_table = ade7854_id,
|
||||
};
|
||||
module_i2c_driver(ade7854_i2c_driver);
|
||||
|
||||
@@ -27,6 +27,9 @@ Now the TODOs:
|
||||
- fix the 'card removal' event when card is inserted when booting
|
||||
- check what other upstream wireless mechanisms can be used instead of the
|
||||
custom ones here
|
||||
- Switch to use LIB80211.
|
||||
- Switch to use MAC80211.
|
||||
- Switch to use CFG80211.
|
||||
|
||||
Please send any patches to:
|
||||
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -161,7 +161,7 @@ static int try_start_dim_transfer(struct hdm_channel *hdm_ch)
|
||||
struct list_head *head = &hdm_ch->pending_list;
|
||||
struct mbo *mbo;
|
||||
unsigned long flags;
|
||||
struct dim_ch_state_t st;
|
||||
struct dim_ch_state st;
|
||||
|
||||
BUG_ON(!hdm_ch);
|
||||
BUG_ON(!hdm_ch->is_initialized);
|
||||
@@ -259,7 +259,7 @@ static void retrieve_netinfo(struct dim2_hdm *dev, struct mbo *mbo)
|
||||
static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
|
||||
{
|
||||
struct hdm_channel *hdm_ch = dev->hch + ch_idx;
|
||||
struct dim_ch_state_t st;
|
||||
struct dim_ch_state st;
|
||||
struct list_head *head;
|
||||
struct mbo *mbo;
|
||||
int done_buffers;
|
||||
|
||||
@@ -943,8 +943,8 @@ u8 dim_service_channel(struct dim_channel *ch)
|
||||
return channel_service(ch);
|
||||
}
|
||||
|
||||
struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch,
|
||||
struct dim_ch_state_t *state_ptr)
|
||||
struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch,
|
||||
struct dim_ch_state *state_ptr)
|
||||
{
|
||||
if (!ch || !state_ptr)
|
||||
return NULL;
|
||||
|
||||
@@ -27,7 +27,7 @@ enum mlb_clk_speed {
|
||||
CLK_8192FS = 7,
|
||||
};
|
||||
|
||||
struct dim_ch_state_t {
|
||||
struct dim_ch_state {
|
||||
bool ready; /* Shows readiness to enqueue next buffer */
|
||||
u16 done_buffers; /* Number of completed buffers */
|
||||
};
|
||||
@@ -87,8 +87,8 @@ void dim_service_ahb_int_irq(struct dim_channel *const *channels);
|
||||
|
||||
u8 dim_service_channel(struct dim_channel *ch);
|
||||
|
||||
struct dim_ch_state_t *dim_get_channel_state(struct dim_channel *ch,
|
||||
struct dim_ch_state_t *state_ptr);
|
||||
struct dim_ch_state *dim_get_channel_state(struct dim_channel *ch,
|
||||
struct dim_ch_state *state_ptr);
|
||||
|
||||
u16 dim_dbr_space(struct dim_channel *ch);
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ static irqreturn_t most_irq_handler(int irq, void *_dev)
|
||||
*
|
||||
* Register the i2c client device as a MOST interface
|
||||
*/
|
||||
static int i2c_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
static int i2c_probe(struct i2c_client *client)
|
||||
{
|
||||
struct hdm_i2c *dev;
|
||||
int ret, i;
|
||||
@@ -359,7 +359,7 @@ static struct i2c_driver i2c_driver = {
|
||||
.driver = {
|
||||
.name = "hdm_i2c",
|
||||
},
|
||||
.probe = i2c_probe,
|
||||
.probe_new = i2c_probe,
|
||||
.remove = i2c_remove,
|
||||
.id_table = i2c_id,
|
||||
};
|
||||
|
||||
@@ -73,7 +73,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
|
||||
{
|
||||
int skb_to_free;
|
||||
int qos, queues_per_port;
|
||||
int total_freed = 0;
|
||||
int total_remaining = 0;
|
||||
unsigned long flags;
|
||||
struct octeon_ethernet *priv = netdev_priv(dev);
|
||||
@@ -87,7 +86,6 @@ static void cvm_oct_free_tx_skbs(struct net_device *dev)
|
||||
MAX_SKB_TO_FREE);
|
||||
skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
|
||||
priv->fau + qos * 4);
|
||||
total_freed += skb_to_free;
|
||||
if (skb_to_free > 0) {
|
||||
struct sk_buff *to_free_list = NULL;
|
||||
|
||||
|
||||
@@ -1212,7 +1212,7 @@ static inline void *cvmx_phys_to_ptr(uint64_t physical_address)
|
||||
return (void *)(uintptr_t)(physical_address);
|
||||
}
|
||||
|
||||
static inline uint64_t cvmx_ptr_to_phys(void *ptr)
|
||||
static inline phys_addr_t cvmx_ptr_to_phys(void *ptr)
|
||||
{
|
||||
return (unsigned long)ptr;
|
||||
}
|
||||
|
||||
@@ -579,7 +579,7 @@ static int dcon_detect(struct i2c_client *client, struct i2c_board_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
|
||||
static int dcon_probe(struct i2c_client *client)
|
||||
{
|
||||
struct dcon_priv *dcon;
|
||||
int rc, i, j;
|
||||
@@ -779,7 +779,7 @@ static struct i2c_driver dcon_driver = {
|
||||
},
|
||||
.class = I2C_CLASS_DDC | I2C_CLASS_HWMON,
|
||||
.id_table = dcon_idtable,
|
||||
.probe = dcon_probe,
|
||||
.probe_new = dcon_probe,
|
||||
.remove = dcon_remove,
|
||||
.detect = dcon_detect,
|
||||
.address_list = normal_i2c,
|
||||
|
||||
@@ -1017,10 +1017,9 @@ u8 ap_free_sta(struct adapter *padapter, struct sta_info *psta,
|
||||
return beacon_updated;
|
||||
}
|
||||
|
||||
int rtw_sta_flush(struct adapter *padapter)
|
||||
void rtw_sta_flush(struct adapter *padapter)
|
||||
{
|
||||
struct list_head *phead, *plist;
|
||||
int ret = 0;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
@@ -1028,7 +1027,7 @@ int rtw_sta_flush(struct adapter *padapter)
|
||||
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
if ((pmlmeinfo->state & 0x03) != WIFI_FW_AP_STATE)
|
||||
return ret;
|
||||
return;
|
||||
|
||||
spin_lock_bh(&pstapriv->asoc_list_lock);
|
||||
phead = &pstapriv->asoc_list;
|
||||
@@ -1050,8 +1049,6 @@ int rtw_sta_flush(struct adapter *padapter)
|
||||
issue_deauth(padapter, bc_addr, WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
||||
associated_clients_update(padapter, true);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* called > TSR LEVEL for USB or SDIO Interface*/
|
||||
|
||||
@@ -50,17 +50,17 @@
|
||||
static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
|
||||
{
|
||||
unsigned char *cur_ptr, *start_ptr;
|
||||
unsigned short tagLen, tagType;
|
||||
unsigned short tag_len, tag_type;
|
||||
|
||||
start_ptr = (unsigned char *)ph->tag;
|
||||
cur_ptr = (unsigned char *)ph->tag;
|
||||
while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
|
||||
/* prevent un-alignment access */
|
||||
tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
|
||||
tagLen = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
|
||||
if (tagType == type)
|
||||
tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
|
||||
tag_len = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
|
||||
if (tag_type == type)
|
||||
return cur_ptr;
|
||||
cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
|
||||
cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -111,32 +111,32 @@ static int __nat25_has_expired(struct nat25_network_db_entry *fdb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
|
||||
unsigned int *ipAddr)
|
||||
static void __nat25_generate_ipv4_network_addr(unsigned char *addr,
|
||||
unsigned int *ip_addr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
memset(addr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_IPV4;
|
||||
memcpy(networkAddr + 7, (unsigned char *)ipAddr, 4);
|
||||
addr[0] = NAT25_IPV4;
|
||||
memcpy(addr + 7, (unsigned char *)ip_addr, 4);
|
||||
}
|
||||
|
||||
static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
|
||||
static void __nat25_generate_pppoe_network_addr(unsigned char *addr,
|
||||
unsigned char *ac_mac, __be16 *sid)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
memset(addr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_PPPOE;
|
||||
memcpy(networkAddr + 1, (unsigned char *)sid, 2);
|
||||
memcpy(networkAddr + 3, (unsigned char *)ac_mac, 6);
|
||||
addr[0] = NAT25_PPPOE;
|
||||
memcpy(addr + 1, (unsigned char *)sid, 2);
|
||||
memcpy(addr + 3, (unsigned char *)ac_mac, 6);
|
||||
}
|
||||
|
||||
static void __nat25_generate_ipv6_network_addr(unsigned char *networkAddr,
|
||||
unsigned int *ipAddr)
|
||||
static void __nat25_generate_ipv6_network_addr(unsigned char *addr,
|
||||
unsigned int *ip_addr)
|
||||
{
|
||||
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
memset(addr, 0, MAX_NETWORK_ADDR_LEN);
|
||||
|
||||
networkAddr[0] = NAT25_IPV6;
|
||||
memcpy(networkAddr + 1, (unsigned char *)ipAddr, 16);
|
||||
addr[0] = NAT25_IPV6;
|
||||
memcpy(addr + 1, (unsigned char *)ip_addr, 16);
|
||||
}
|
||||
|
||||
static unsigned char *scan_tlv(unsigned char *data, int len, unsigned char tag, unsigned char len8b)
|
||||
@@ -200,40 +200,40 @@ static int update_nd_link_layer_addr(unsigned char *data, int len, unsigned char
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __nat25_network_hash(unsigned char *networkAddr)
|
||||
static int __nat25_network_hash(unsigned char *addr)
|
||||
{
|
||||
if (networkAddr[0] == NAT25_IPV4) {
|
||||
if (addr[0] == NAT25_IPV4) {
|
||||
unsigned long x;
|
||||
|
||||
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
|
||||
x = addr[7] ^ addr[8] ^ addr[9] ^ addr[10];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
} else if (networkAddr[0] == NAT25_IPX) {
|
||||
} else if (addr[0] == NAT25_IPX) {
|
||||
unsigned long x;
|
||||
|
||||
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^
|
||||
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
|
||||
x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^
|
||||
addr[6] ^ addr[7] ^ addr[8] ^ addr[9] ^ addr[10];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
} else if (networkAddr[0] == NAT25_APPLE) {
|
||||
} else if (addr[0] == NAT25_APPLE) {
|
||||
unsigned long x;
|
||||
|
||||
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
|
||||
x = addr[1] ^ addr[2] ^ addr[3];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
} else if (networkAddr[0] == NAT25_PPPOE) {
|
||||
} else if (addr[0] == NAT25_PPPOE) {
|
||||
unsigned long x;
|
||||
|
||||
x = networkAddr[0] ^ networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^ networkAddr[6] ^ networkAddr[7] ^ networkAddr[8];
|
||||
x = addr[0] ^ addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^
|
||||
addr[5] ^ addr[6] ^ addr[7] ^ addr[8];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
} else if (networkAddr[0] == NAT25_IPV6) {
|
||||
} else if (addr[0] == NAT25_IPV6) {
|
||||
unsigned long x;
|
||||
|
||||
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3] ^ networkAddr[4] ^ networkAddr[5] ^
|
||||
networkAddr[6] ^ networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10] ^
|
||||
networkAddr[11] ^ networkAddr[12] ^ networkAddr[13] ^ networkAddr[14] ^ networkAddr[15] ^
|
||||
networkAddr[16];
|
||||
x = addr[1] ^ addr[2] ^ addr[3] ^ addr[4] ^ addr[5] ^ addr[6] ^
|
||||
addr[7] ^ addr[8] ^ addr[9] ^ addr[10] ^ addr[11] ^ addr[12] ^
|
||||
addr[13] ^ addr[14] ^ addr[15] ^ addr[16];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
} else {
|
||||
@@ -241,7 +241,7 @@ static int __nat25_network_hash(unsigned char *networkAddr)
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_NETWORK_ADDR_LEN; i++)
|
||||
x ^= networkAddr[i];
|
||||
x ^= addr[i];
|
||||
|
||||
return x & (NAT25_HASH_SIZE - 1);
|
||||
}
|
||||
@@ -269,17 +269,17 @@ static void __network_hash_unlink(struct nat25_network_db_entry *ent)
|
||||
}
|
||||
|
||||
static void __nat25_db_network_insert(struct adapter *priv,
|
||||
unsigned char *macAddr, unsigned char *networkAddr)
|
||||
unsigned char *mac_addr, unsigned char *addr)
|
||||
{
|
||||
struct nat25_network_db_entry *db;
|
||||
int hash;
|
||||
|
||||
spin_lock_bh(&priv->br_ext_lock);
|
||||
hash = __nat25_network_hash(networkAddr);
|
||||
hash = __nat25_network_hash(addr);
|
||||
db = priv->nethash[hash];
|
||||
while (db) {
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
|
||||
memcpy(db->macAddr, macAddr, ETH_ALEN);
|
||||
if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN)) {
|
||||
memcpy(db->macAddr, mac_addr, ETH_ALEN);
|
||||
db->ageing_timer = jiffies;
|
||||
spin_unlock_bh(&priv->br_ext_lock);
|
||||
return;
|
||||
@@ -291,8 +291,8 @@ static void __nat25_db_network_insert(struct adapter *priv,
|
||||
spin_unlock_bh(&priv->br_ext_lock);
|
||||
return;
|
||||
}
|
||||
memcpy(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN);
|
||||
memcpy(db->macAddr, macAddr, ETH_ALEN);
|
||||
memcpy(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN);
|
||||
memcpy(db->macAddr, mac_addr, ETH_ALEN);
|
||||
atomic_set(&db->use_count, 1);
|
||||
db->ageing_timer = jiffies;
|
||||
|
||||
@@ -366,7 +366,7 @@ void nat25_db_expire(struct adapter *priv)
|
||||
int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
||||
{
|
||||
unsigned short protocol;
|
||||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
unsigned char addr[MAX_NETWORK_ADDR_LEN];
|
||||
unsigned int tmp;
|
||||
|
||||
if (!skb)
|
||||
@@ -395,9 +395,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
||||
if (iph->saddr == 0)
|
||||
return 0;
|
||||
tmp = be32_to_cpu(iph->saddr);
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, &tmp);
|
||||
__nat25_generate_ipv4_network_addr(addr, &tmp);
|
||||
/* record source IP address and , source mac address into db */
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
@@ -421,8 +421,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
||||
memcpy(arp_ptr, GET_MY_HWADDR(priv), ETH_ALEN);
|
||||
arp_ptr += arp->ar_hln;
|
||||
sender = (unsigned int *)arp_ptr;
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, sender);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
|
||||
__nat25_generate_ipv4_network_addr(addr, sender);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
|
||||
return 0;
|
||||
default:
|
||||
return -1;
|
||||
@@ -495,9 +495,9 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
||||
return -1;
|
||||
}
|
||||
} else { /* session phase */
|
||||
__nat25_generate_pppoe_network_addr(networkAddr, skb->data, &ph->sid);
|
||||
__nat25_generate_pppoe_network_addr(addr, skb->data, &ph->sid);
|
||||
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
|
||||
|
||||
if (!priv->ethBrExtInfo.addPPPoETag &&
|
||||
priv->pppoe_connection_in_progress &&
|
||||
@@ -548,8 +548,8 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
|
||||
return -1;
|
||||
case NAT25_INSERT:
|
||||
if (memcmp(&iph->saddr, "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0", 16)) {
|
||||
__nat25_generate_ipv6_network_addr(networkAddr, (unsigned int *)&iph->saddr);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
|
||||
__nat25_generate_ipv6_network_addr(addr, (unsigned int *)&iph->saddr);
|
||||
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, addr);
|
||||
|
||||
if (iph->nexthdr == IPPROTO_ICMPV6 &&
|
||||
skb->len > (ETH_HLEN + sizeof(*iph) + 4)) {
|
||||
@@ -606,17 +606,16 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
|
||||
if (!priv->ethBrExtInfo.dhcp_bcst_disable) {
|
||||
__be16 protocol = *((__be16 *)(skb->data + 2 * ETH_ALEN));
|
||||
|
||||
if (protocol == __constant_htons(ETH_P_IP)) { /* IP */
|
||||
if (protocol == htons(ETH_P_IP)) { /* IP */
|
||||
struct iphdr *iph = (struct iphdr *)(skb->data + ETH_HLEN);
|
||||
|
||||
if (iph->protocol == IPPROTO_UDP) { /* UDP */
|
||||
struct udphdr *udph = (struct udphdr *)((size_t)iph + (iph->ihl << 2));
|
||||
struct udphdr *udph = (void *)iph + (iph->ihl << 2);
|
||||
|
||||
if ((udph->source == __constant_htons(CLIENT_PORT)) &&
|
||||
(udph->dest == __constant_htons(SERVER_PORT))) { /* DHCP request */
|
||||
struct dhcpMessage *dhcph =
|
||||
(struct dhcpMessage *)((size_t)udph + sizeof(struct udphdr));
|
||||
u32 cookie = be32_to_cpu((__be32)dhcph->cookie);
|
||||
if ((udph->source == htons(CLIENT_PORT)) &&
|
||||
(udph->dest == htons(SERVER_PORT))) { /* DHCP request */
|
||||
struct dhcpMessage *dhcph = (void *)udph + sizeof(struct udphdr);
|
||||
u32 cookie = be32_to_cpu(dhcph->cookie);
|
||||
|
||||
if (cookie == DHCP_MAGIC) { /* match magic word */
|
||||
if (!(dhcph->flags & htons(BROADCAST_FLAG))) {
|
||||
@@ -639,19 +638,18 @@ void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb)
|
||||
}
|
||||
}
|
||||
|
||||
void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr)
|
||||
void *scdb_findEntry(struct adapter *priv, unsigned char *ip_addr)
|
||||
{
|
||||
unsigned char networkAddr[MAX_NETWORK_ADDR_LEN];
|
||||
unsigned char addr[MAX_NETWORK_ADDR_LEN];
|
||||
struct nat25_network_db_entry *db;
|
||||
int hash;
|
||||
|
||||
__nat25_generate_ipv4_network_addr(networkAddr, (unsigned int *)ipAddr);
|
||||
hash = __nat25_network_hash(networkAddr);
|
||||
__nat25_generate_ipv4_network_addr(addr, (unsigned int *)ip_addr);
|
||||
hash = __nat25_network_hash(addr);
|
||||
db = priv->nethash[hash];
|
||||
while (db) {
|
||||
if (!memcmp(db->networkAddr, networkAddr, MAX_NETWORK_ADDR_LEN)) {
|
||||
if (!memcmp(db->networkAddr, addr, MAX_NETWORK_ADDR_LEN))
|
||||
return (void *)db;
|
||||
}
|
||||
|
||||
db = db->next_hash;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ exit:
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
{
|
||||
init_completion(&pcmdpriv->enqueue_cmd);
|
||||
/* sema_init(&(pcmdpriv->cmd_done_sema), 0); */
|
||||
@@ -71,7 +71,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
GFP_KERNEL);
|
||||
|
||||
if (!pcmdpriv->cmd_allocated_buf)
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
|
||||
pcmdpriv->cmd_buf = pcmdpriv->cmd_allocated_buf + CMDBUFF_ALIGN_SZ - ((size_t)(pcmdpriv->cmd_allocated_buf) & (CMDBUFF_ALIGN_SZ - 1));
|
||||
|
||||
@@ -79,7 +79,7 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
|
||||
if (!pcmdpriv->rsp_allocated_buf) {
|
||||
kfree(pcmdpriv->cmd_allocated_buf);
|
||||
return _FAIL;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
@@ -87,13 +87,11 @@ u32 rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
|
||||
return _SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
int rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
{
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
||||
atomic_set(&pevtpriv->event_seq, 0);
|
||||
|
||||
@@ -101,9 +99,9 @@ u32 rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
pevtpriv->c2h_wk_alive = false;
|
||||
pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
|
||||
if (!pevtpriv->c2h_queue)
|
||||
res = _FAIL;
|
||||
return -ENOMEM;
|
||||
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
@@ -342,33 +340,29 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
||||
return res;
|
||||
}
|
||||
|
||||
u8 rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)
|
||||
int rtw_setdatarate_cmd(struct adapter *padapter, u8 *rateset)
|
||||
{
|
||||
struct cmd_obj *ph2c;
|
||||
struct setdatarate_parm *pbsetdataratepara;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
u8 res = _SUCCESS;
|
||||
|
||||
ph2c = kzalloc(sizeof(*ph2c), GFP_ATOMIC);
|
||||
if (!ph2c) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (!ph2c)
|
||||
return -ENOMEM;
|
||||
|
||||
pbsetdataratepara = kzalloc(sizeof(*pbsetdataratepara), GFP_ATOMIC);
|
||||
if (!pbsetdataratepara) {
|
||||
kfree(ph2c);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pbsetdataratepara, GEN_CMD_CODE(_SetDataRate));
|
||||
pbsetdataratepara->mac_id = 5;
|
||||
memcpy(pbsetdataratepara->datarates, rateset, NumRates);
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
exit:
|
||||
if (rtw_enqueue_cmd(pcmdpriv, ph2c) == _FAIL)
|
||||
return -EPERM;
|
||||
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void rtw_getbbrfreg_cmdrsp_callback(struct adapter *padapter, struct cmd_obj *pcmd)
|
||||
|
||||
@@ -287,7 +287,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
|
||||
|
||||
if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have chked whether issue dis-assoc_cmd or not */
|
||||
rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
|
||||
}
|
||||
|
||||
*pold_state = networktype;
|
||||
@@ -314,7 +314,7 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
|
||||
return true;
|
||||
}
|
||||
|
||||
u8 rtw_set_802_11_disassociate(struct adapter *padapter)
|
||||
void rtw_set_802_11_disassociate(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
@@ -328,8 +328,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user