3
0
mirror of https://github.com/Qortal/Brooklyn.git synced 2025-01-30 14:52:17 +00:00

Tweaks for Sinclair network stack

This commit is contained in:
Scare Crowe 2021-11-09 16:55:03 +05:00
parent 31c0a36d75
commit a56f476991
10 changed files with 98 additions and 38 deletions

View File

@ -377,9 +377,6 @@ static int amba_device_try_add(struct amba_device *dev, struct resource *parent)
void __iomem *tmp;
int i, ret;
WARN_ON(dev->irq[0] == (unsigned int)-1);
WARN_ON(dev->irq[1] == (unsigned int)-1);
ret = request_resource(parent, &dev->res);
if (ret)
goto err_out;

View File

@ -563,20 +563,14 @@ int efx_ethtool_get_link_ksettings(struct net_device *net_dev,
{
struct efx_nic *efx = netdev_priv(net_dev);
struct efx_link_state *link_state = &efx->link_state;
u32 supported;
mutex_lock(&efx->mac_lock);
efx_mcdi_phy_get_link_ksettings(efx, cmd);
mutex_unlock(&efx->mac_lock);
/* Both MACs support pause frames (bidirectional and respond-only) */
ethtool_convert_link_mode_to_legacy_u32(&supported,
cmd->link_modes.supported);
supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_link_ksettings_add_link_mode(cmd, supported, Pause);
ethtool_link_ksettings_add_link_mode(cmd, supported, Asym_Pause);
if (LOOPBACK_INTERNAL(efx)) {
cmd->base.speed = link_state->speed;

View File

@ -604,15 +604,6 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
}
}
}
/* FIXME: Only enable bmps support when encryption is enabled.
* For any reasons, when connected to open/no-security BSS,
* the wcn36xx controller in bmps mode does not forward
* 'wake-up' beacons despite AP sends DTIM with station AID.
* It could be due to a firmware issue or to the way driver
* configure the station.
*/
if (vif->type == NL80211_IFTYPE_STATION)
vif_priv->allow_bmps = true;
break;
case DISABLE_KEY:
if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {
@ -913,7 +904,6 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw *hw,
vif->addr,
bss_conf->aid);
vif_priv->sta_assoc = false;
vif_priv->allow_bmps = false;
wcn36xx_smd_set_link_st(wcn,
bss_conf->bssid,
vif->addr,

View File

@ -23,10 +23,7 @@ int wcn36xx_pmc_enter_bmps_state(struct wcn36xx *wcn,
{
int ret = 0;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
if (!vif_priv->allow_bmps)
return -ENOTSUPP;
/* TODO: Make sure the TX chain clean */
ret = wcn36xx_smd_enter_bmps(wcn, vif);
if (!ret) {
wcn36xx_dbg(WCN36XX_DBG_PMC, "Entered BMPS\n");

View File

@ -128,7 +128,6 @@ struct wcn36xx_vif {
enum wcn36xx_hal_bss_type bss_type;
/* Power management */
bool allow_bmps;
enum wcn36xx_power_state pw_state;
u8 bss_index;

View File

@ -67,7 +67,12 @@ void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...);
#if defined(DEBUG) || defined(CONFIG_BRCM_TRACING)
/* For debug/tracing purposes treat info messages as errors */
#define brcmf_info brcmf_err
// #define brcmf_info brcmf_err
#define brcmf_info(fmt, ...) \
do { \
pr_info("%s: " fmt, __func__, ##__VA_ARGS__); \
} while (0)
__printf(3, 4)
void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...);

View File

@ -10,6 +10,7 @@
#include "debug.h"
#include "core.h"
#include "common.h"
#include "firmware.h"
#include "of.h"
static int brcmf_of_get_country_codes(struct device *dev,
@ -118,3 +119,38 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
sdio->oob_irq_nr = irq;
sdio->oob_irq_flags = irqf;
}
struct brcmf_firmware_mapping *
brcmf_of_fwnames(struct device *dev, u32 *fwname_count)
{
struct device_node *np = dev->of_node;
struct brcmf_firmware_mapping *fwnames;
struct device_node *map_np, *fw_np;
int of_count;
int count = 0;
map_np = of_get_child_by_name(np, "firmwares");
of_count = of_get_child_count(map_np);
if (!of_count)
return NULL;
fwnames = devm_kcalloc(dev, of_count,
sizeof(struct brcmf_firmware_mapping),
GFP_KERNEL);
for_each_child_of_node(map_np, fw_np)
{
struct brcmf_firmware_mapping *cur = &fwnames[count];
if (of_property_read_u32(fw_np, "chipid", &cur->chipid) ||
of_property_read_u32(fw_np, "revmask", &cur->revmask))
continue;
cur->fw_base = of_get_property(fw_np, "fw_base", NULL);
if (cur->fw_base)
count++;
}
*fwname_count = count;
return count ? fwnames : NULL;
}

View File

@ -5,9 +5,16 @@
#ifdef CONFIG_OF
void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
struct brcmf_mp_device *settings);
struct brcmf_firmware_mapping *
brcmf_of_fwnames(struct device *dev, u32 *map_count);
#else
static void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,
struct brcmf_mp_device *settings)
{
}
static struct brcmf_firmware_mapping *
brcmf_of_fwnames(struct device *dev, u32 *map_count)
{
return NULL;
}
#endif /* CONFIG_OF */

View File

@ -35,6 +35,7 @@
#include "core.h"
#include "common.h"
#include "bcdc.h"
#include "of.h"
#define DCMD_RESP_TIMEOUT msecs_to_jiffies(2500)
#define CTL_DONE_TIMEOUT msecs_to_jiffies(2500)
@ -616,7 +617,6 @@ BRCMF_FW_DEF(4335, "brcmfmac4335-sdio");
BRCMF_FW_DEF(43362, "brcmfmac43362-sdio");
BRCMF_FW_DEF(4339, "brcmfmac4339-sdio");
BRCMF_FW_DEF(43430A0, "brcmfmac43430a0-sdio");
BRCMF_FW_DEF(43436, "brcmfmac43436-sdio");
/* Note the names are not postfixed with a1 for backward compatibility */
BRCMF_FW_CLM_DEF(43430A1, "brcmfmac43430-sdio");
BRCMF_FW_DEF(43430B0, "brcmfmac43430b0-sdio");
@ -636,7 +636,7 @@ MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-pcie.*.txt");
/* per-board firmware binaries */
MODULE_FIRMWARE(BRCMF_FW_DEFAULT_PATH "brcmfmac*-sdio.*.bin");
static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
static const struct brcmf_firmware_mapping sdio_fwnames[] = {
BRCMF_FW_ENTRY(BRCM_CC_43143_CHIP_ID, 0xFFFFFFFF, 43143),
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x0000001F, 43241B0),
BRCMF_FW_ENTRY(BRCM_CC_43241_CHIP_ID, 0x00000020, 43241B4),
@ -651,8 +651,6 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000002, 43430A1),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000004, 43436),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFA, 43430A1),
BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFC, 43430B0),
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456),
BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455),
@ -664,6 +662,9 @@ static const struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = {
BRCMF_FW_ENTRY(CY_CC_43752_CHIP_ID, 0xFFFFFFFF, 43752)
};
static const struct brcmf_firmware_mapping *brcmf_sdio_fwnames;
static u32 brcmf_sdio_fwnames_count;
#define TXCTL_CREDITS 2
static void pkt_align(struct sk_buff *p, int len, int align)
@ -4155,7 +4156,7 @@ int brcmf_sdio_get_fwname(struct device *dev, const char *ext, u8 *fw_name,
}
fwreq = brcmf_fw_alloc_request(bus_if->chip, bus_if->chiprev,
brcmf_sdio_fwnames,
ARRAY_SIZE(brcmf_sdio_fwnames),
brcmf_sdio_fwnames_count,
fwnames, ARRAY_SIZE(fwnames));
if (!fwreq)
return -ENOMEM;
@ -4211,6 +4212,9 @@ static const struct brcmf_bus_ops brcmf_sdio_bus_ops = {
#define BRCMF_SDIO_FW_CODE 0
#define BRCMF_SDIO_FW_NVRAM 1
static struct brcmf_fw_request *
brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus);
static void brcmf_sdio_firmware_callback(struct device *dev, int err,
struct brcmf_fw_request *fwreq)
{
@ -4226,6 +4230,22 @@ static void brcmf_sdio_firmware_callback(struct device *dev, int err,
brcmf_dbg(TRACE, "Enter: dev=%s, err=%d\n", dev_name(dev), err);
if (err && brcmf_sdio_fwnames != sdio_fwnames) {
/* Try again with the standard firmware names */
brcmf_sdio_fwnames = sdio_fwnames;
brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
kfree(fwreq);
fwreq = brcmf_sdio_prepare_fw_request(bus);
if (!fwreq) {
err = -ENOMEM;
goto fail;
}
err = brcmf_fw_get_firmwares(dev, fwreq,
brcmf_sdio_firmware_callback);
if (!err)
return;
}
if (err)
goto fail;
@ -4434,7 +4454,7 @@ brcmf_sdio_prepare_fw_request(struct brcmf_sdio *bus)
fwreq = brcmf_fw_alloc_request(bus->ci->chip, bus->ci->chiprev,
brcmf_sdio_fwnames,
ARRAY_SIZE(brcmf_sdio_fwnames),
brcmf_sdio_fwnames_count,
fwnames, ARRAY_SIZE(fwnames));
if (!fwreq)
return NULL;
@ -4452,6 +4472,9 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
struct brcmf_sdio *bus;
struct workqueue_struct *wq;
struct brcmf_fw_request *fwreq;
struct brcmf_firmware_mapping *of_fwnames, *fwnames = NULL;
const int fwname_size = sizeof(struct brcmf_firmware_mapping);
u32 of_fw_count;
brcmf_dbg(TRACE, "Enter\n");
@ -4534,6 +4557,23 @@ struct brcmf_sdio *brcmf_sdio_probe(struct brcmf_sdio_dev *sdiodev)
brcmf_dbg(INFO, "completed!!\n");
brcmf_sdio_fwnames = sdio_fwnames;
brcmf_sdio_fwnames_count = ARRAY_SIZE(sdio_fwnames);
of_fwnames = brcmf_of_fwnames(sdiodev->dev, &of_fw_count);
if (of_fwnames)
fwnames = devm_kcalloc(sdiodev->dev,
of_fw_count + brcmf_sdio_fwnames_count,
fwname_size, GFP_KERNEL);
if (fwnames) {
/* The array is scanned in order, so overrides come first */
memcpy(fwnames, of_fwnames, of_fw_count * fwname_size);
memcpy(fwnames + of_fw_count, sdio_fwnames,
brcmf_sdio_fwnames_count * fwname_size);
brcmf_sdio_fwnames = fwnames;
brcmf_sdio_fwnames_count += of_fw_count;
}
fwreq = brcmf_sdio_prepare_fw_request(bus);
if (!fwreq) {
ret = -ENOMEM;

View File

@ -597,11 +597,6 @@ static const struct bcm2835_codec_fmt supported_formats[] = {
.depth = 0,
.flags = V4L2_FMT_FLAG_COMPRESSED,
.mmal_fmt = MMAL_ENCODING_MP2V,
}, {
.fourcc = V4L2_PIX_FMT_VP8,
.depth = 0,
.flags = V4L2_FMT_FLAG_COMPRESSED,
.mmal_fmt = MMAL_ENCODING_VP8,
}, {
.fourcc = V4L2_PIX_FMT_VC1_ANNEX_G,
.depth = 0,