8dd79199f8
The bes2600 driver is a fork of the upstream cw1200 driver
(drivers/net/wireless/st/cw1200/, ST-Ericsson, Dmitry Tarnyagin
2010-2011). The fork's file headers have three GPL-compliance issues:
1. NO SPDX-License-Identifier on any of 48 source files (cw1200
mainline has them on all 25). kernel.org-mandated since 2017.
2. Original "Copyright (c) 2010, ST-Ericsson" lines stripped from
all files inherited from cw1200, replaced with
"Copyright (c) 2010, Bestechnic" — factually impossible
(Bestechnic did not author the 2010 work) and a GPL-2.0 §1
attribution-preservation violation.
3. The "GPL version 2 as published by the Free Software Foundation"
boilerplate paragraph is redundant alongside SPDX and is the
legacy form modern kernel sources have replaced.
This patch corrects all three for the 48 .c/.h files in bes2600/:
- Adds `// SPDX-License-Identifier: GPL-2.0-only` (or `/* ... */`
for headers) as line 1 of every file.
- Restores `Copyright (c) 2010, ST-Ericsson` + `Author: Dmitry
Tarnyagin <dmitry.tarnyagin@lockless.no>` as the FIRST copyright
chain entry on all 22 files derived from cw1200 (bh.{c,h},
debug.{c,h}, fwio.{c,h}, hwio.{c,h}, main.c, pm.{c,h},
queue.{c,h}, scan.{c,h}, sta.{c,h}, txrx.{c,h}, wsm.{c,h}).
- Keeps `Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.` as
the SECOND chain entry where Bestechnic genuinely contributed.
- Notes "Derived from cw1200_sdio.c" + ST-Ericsson copyright on
bes2600_sdio.c (heavy derivation, not a literal rename).
- Notes "Replaces hwbus.h from cw1200/" + ST-Ericsson copyright
on sbus.h.
- Preserves the prism54/islsm authorship chain on main.c and
bes2600.h (Michael Wu 2006 + Jean-Baptiste Note 2004-2006).
- Drops the GPL-2.0 boilerplate paragraph in favour of SPDX.
No code changes — only file-header comment blocks. Module build is
unaffected (verified by header-only diff scope).
This is a prerequisite for any kernel.org submission attempt. The
existing MODULE_LICENSE("GPL") + MODULE_AUTHOR(Tarnyagin@stericsson.com)
declarations were already present and are unchanged here; the
mismatch between MODULE_AUTHOR and the (since-corrected) per-file
copyrights is now resolved.
102 lines
3.3 KiB
C
102 lines
3.3 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Bus abstraction interface for BES2600
|
|
*
|
|
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
|
|
* Replaces hwbus.h from drivers/net/wireless/st/cw1200/
|
|
* Copyright (c) 2010, ST-Ericsson
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef BES2600_SBUS_H
|
|
#define BES2600_SBUS_H
|
|
|
|
/*
|
|
* sbus priv forward definition.
|
|
* Implemented and instantiated in particular modules.
|
|
*/
|
|
struct sbus_priv;
|
|
struct bes2600_common;
|
|
|
|
typedef void (*sbus_irq_handler)(void *priv);
|
|
|
|
enum SUBSYSTEM {
|
|
SUBSYSTEM_MCU = 0,
|
|
SUBSYSTEM_WIFI,
|
|
SUBSYSTEM_BT,
|
|
SUBSYSTEM_BT_LP,
|
|
};
|
|
|
|
enum GPIO_WAKE_FLAG
|
|
{
|
|
GPIO_WAKE_FLAG_MCU = 0,
|
|
GPIO_WAKE_FLAG_WIFI_ON,
|
|
GPIO_WAKE_FLAG_WIFI_OFF,
|
|
GPIO_WAKE_FLAG_BT_ON,
|
|
GPIO_WAKE_FLAG_BT_OFF,
|
|
GPIO_WAKE_FLAG_BT_LP_ON,
|
|
GPIO_WAKE_FLAG_BT_LP_OFF,
|
|
GPIO_WAKE_FLAG_HOST_SUSPEND,
|
|
GPIO_WAKE_FLAG_HOST_RESUME,
|
|
GPIO_WAKE_FLAG_SDIO_RX,
|
|
GPIO_WAKE_FLAG_SDIO_PROBE,
|
|
};
|
|
|
|
struct sbus_ops {
|
|
int (*init)(struct sbus_priv *self, struct bes2600_common *core);
|
|
int (*sbus_memcpy_fromio)(struct sbus_priv *self, unsigned int addr,
|
|
void *dst, int count);
|
|
int (*sbus_memcpy_toio)(struct sbus_priv *self, unsigned int addr,
|
|
const void *src, int count);
|
|
void (*lock)(struct sbus_priv *self);
|
|
void (*unlock)(struct sbus_priv *self);
|
|
int (*irq_subscribe)(struct sbus_priv *self, sbus_irq_handler handler,
|
|
void *priv);
|
|
int (*irq_unsubscribe)(struct sbus_priv *self);
|
|
int (*reset)(struct sbus_priv *self);
|
|
size_t (*align_size)(struct sbus_priv *self, size_t size);
|
|
int (*set_block_size)(struct sbus_priv *self, size_t size);
|
|
int (*pipe_send)(struct sbus_priv *self, u8 pipe, u32 len, u8 *buf);
|
|
void * (*pipe_read)(struct sbus_priv *self);
|
|
int (*sbus_reg_read)(struct sbus_priv *self, u32 reg,
|
|
void *buf, int count);
|
|
int (*sbus_reg_write)(struct sbus_priv *self, u32 reg,
|
|
const void *buf, int count);
|
|
|
|
/* sub_system: 0 for mcu, 1 for wifi, 2 for bt, ... */
|
|
int (*sbus_active)(struct sbus_priv *self, int sub_system);
|
|
int (*sbus_deactive)(struct sbus_priv *self, int sub_system);
|
|
int (*power_switch)(struct sbus_priv *self, int on);
|
|
/* gpio wake, beacuse bes2600 sdio can't wakeup mcu, so add the two of interfaces */
|
|
void (*gpio_wake)(struct sbus_priv *self, int falg);
|
|
void (*gpio_sleep)(struct sbus_priv *self, int falg);
|
|
/* halt device to get debug information */
|
|
void (*halt_device)(struct sbus_priv *self);
|
|
bool (*wakeup_source)(struct sbus_priv *self);
|
|
int (*reboot)(struct sbus_priv *self);
|
|
/*
|
|
* Force the host bus to re-detect and re-probe the chip. Called
|
|
* from the firmware-wedge recovery path when power_switch() has no
|
|
* effective chip-reset signal of its own (e.g. PineTab2, where the
|
|
* wifi-reset GPIO is owned by sdio_pwrseq, not the bes2600 node).
|
|
* Returns 0 on success or a negative errno.
|
|
*/
|
|
int (*bus_reset)(struct sbus_priv *self);
|
|
/*
|
|
* Read a batch of RX frames inline from the bus and deliver each
|
|
* one via bes2600_bh_handle_rx_skb(). Called from the bh thread
|
|
* (process context, sleepable). Replaces the
|
|
* sdio_rx_work + rx_queue + pipe_read relay (Patch C v3, 2026).
|
|
* Returns 0 on success, negative on read error.
|
|
*/
|
|
int (*bus_rx_batch)(struct sbus_priv *self);
|
|
};
|
|
|
|
void bes2600_irq_handler(struct bes2600_common *priv);
|
|
|
|
/* This MUST be wrapped with hwbus_ops->lock/unlock! */
|
|
int __bes2600_irq_enable(int enable);
|
|
|
|
#endif /* BES2600_SBUS_H */
|