Files
bes2600-dkms/bes2600/bes_chardev.h
T
test0r 8dd79199f8 bes2600: Patch G — restore SPDX identifiers + ST-Ericsson attribution
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.
2026-05-08 00:03:50 +02:00

96 lines
2.7 KiB
C

/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Character device interface for BES2600
*
* Copyright (c) 2022, Bestechnic (Beijing) Co., Ltd.
*
*/
#ifndef __BES_CHARDEV_H__
#define __BES_CHARDEV_H__
#define BES2600_FW_TYPE_WIFI_SIGNAL 0
#define BES2600_FW_TYPE_WIFI_NO_SIGNAL 1
#define BES2600_FW_TYPE_BT 2
#define BES2600_FW_TYPE_MAX_NUM 3
#define DPD_VERSION_OFFSET 0x3AF4
#define DPD_BIN_SIZE 0x3B14
#define DPD_BIN_FILE_SIZE 0x4000
#define DPD_CUR_VERSION 7
enum pend_read_op {
BES_CDEV_READ_WAKEUP_STATE = 0,
/* add new here */
BES_CDEV_READ_NUM_MAX,
};
enum wifi_wakeup_reason_code {
WAKEUP_REASON_WIFI_DEAUTH_DISASSOC = 0x1000,
WAKEUP_REASON_WIFI_BSSLOST,
/* add new here */
};
enum bt_wakeup_reason_code {
WAKEUP_REASON_BT_PLAY = 0x0100,
/* add new here */
};
enum wakeup_event {
WAKEUP_EVENT_NONE = 0,
WAKEUP_EVENT_SETTING,
WAKEUP_EVENT_WSME,
WAKEUP_EVENT_PEER_DETACH,
/* add new here */
};
/* dpd management */
u8* bes2600_chrdev_get_dpd_buffer(u32 size);
int bes2600_chrdev_update_dpd_data(void);
const u8* bes2600_chrdev_get_dpd_data(u32 *len);
void bes2600_chrdev_free_dpd_data(void);
/* get/set subs_priv instance from/to bes_chrdev module */
void bes2600_chrdev_set_sbus_priv_data(struct sbus_priv *priv, bool error);
struct sbus_priv *bes2600_chrdev_get_sbus_priv_data(void);
/* used to control device power down */
int bes2600_chrdev_check_system_close(void);
int bes2600_chrdev_do_system_close(const struct sbus_ops *sbus_ops, struct sbus_priv *priv);
int bes2600_chrdev_do_bus_reset(const struct sbus_ops *sbus_ops, struct sbus_priv *priv);
int bes2600_chrdev_trigger_bus_reset(void);
void bes2600_chrdev_wakeup_bt(void);
void bes2600_chrdev_wifi_force_close(struct bes2600_common *hw_priv, bool halt_dev);
void bes2600_chrdev_usb_remove(struct bes2600_common *hw_priv);
/* get and set internal state */
bool bes2600_chrdev_is_wifi_opened(void);
bool bes2600_chrdev_is_bt_opened(void);
int bes2600_chrdev_get_fw_type(void);
bool bes2600_chrdev_is_signal_mode(void);
void bes2600_chrdev_update_signal_mode(void);
bool bes2600_chrdev_is_bus_error(void);
/* bus probe check */
void bes2600_chrdev_start_bus_probe(void);
void bes2600_chrdev_bus_probe_notify(void);
/* set wifi wakeup state */
void bes2600_chrdev_wifi_update_wakeup_reason(u16 reason, u16 port);
void bes2600_chrdev_wakeup_by_event_set(enum wakeup_event wakeup_event);
int bes2600_chrdev_wakeup_by_event_get(void);
/* init and deinit module */
int bes2600_chrdev_init(struct sbus_ops *ops);
void bes2600_chrdev_free(void);
#ifdef BES2600_DUMP_FW_DPD_LOG
void bes2600_free_dpd_log_buffer(void);
u8* bes2600_alloc_dpd_log_buffer(u16 len);
void bes2600_get_dpd_log(char **data, size_t *len);
#endif
int bes2600_switch_bt(bool);
#endif /* __BES_CHARDEV_H__ */