0
0
Fork 0

forward port fixes from older version

This commit is contained in:
Daryl Ronningen 2023-10-12 16:44:32 -07:00
parent d5bdeb9503
commit d78cd50cca
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
4 changed files with 12 additions and 7 deletions

View file

@ -583,7 +583,12 @@ static struct hgicf_vif *hgicf_create_iface(struct hgicf_wdev *hg)
vif->hg = hg; vif->hg = hg;
vif->opened = 0; vif->opened = 0;
ndev->needed_headroom += (hg->bus->drv_tx_headroom + sizeof(struct hgic_frm_hdr2) + 4); ndev->needed_headroom += (hg->bus->drv_tx_headroom + sizeof(struct hgic_frm_hdr2) + 4);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
memcpy(ndev->dev_addr, hg->fwinfo.mac, ETH_ALEN); memcpy(ndev->dev_addr, hg->fwinfo.mac, ETH_ALEN);
#else
eth_hw_addr_set(ndev, hg->fwinfo.mac);
#endif
ret = register_netdev(ndev); ret = register_netdev(ndev);
if (ret) { if (ret) {
@ -610,11 +615,7 @@ static void hgicf_rx_single_frm(struct hgicf_wdev *hg, u8 *data, int len)
skb_put(skb, len); skb_put(skb, len);
skb->dev = hg->vif->ndev; skb->dev = hg->vif->ndev;
skb->protocol = eth_type_trans(skb, skb->dev); skb->protocol = eth_type_trans(skb, skb->dev);
if (in_interrupt()) {
netif_rx(skb); netif_rx(skb);
} else {
netif_rx_ni(skb);
}
} else { } else {
hg->vif->stats.rx_dropped += len; hg->vif->stats.rx_dropped += len;
hgic_err("alloc skb fail, len=%d\r\n", len); hgic_err("alloc skb fail, len=%d\r\n", len);

View file

@ -8,6 +8,10 @@
#include "hgicf.h" #include "hgicf.h"
#include "ctrl.h" #include "ctrl.h"
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 16, 0)
#define PDE_DATA(inode) pde_data(inode)
#endif
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
static int hgicf_status_show(struct seq_file *seq, void *v) static int hgicf_status_show(struct seq_file *seq, void *v)
{ {

View file

@ -267,7 +267,7 @@ int hgic_bootdl_cmd_enter(struct hgic_bootdl *hg)
skb = hgic_bootdl_alloc_cmd_skb(hg, HG_BOOTDL_CMD_ENTER); skb = hgic_bootdl_alloc_cmd_skb(hg, HG_BOOTDL_CMD_ENTER);
if (skb) { if (skb) {
cmd_hdr = (struct hgic_bootdl_cmd_hdr *)skb->data; cmd_hdr = (struct hgic_bootdl_cmd_hdr *)skb->data;
memcpy((void *)cmd_hdr->addr, (void *)BOOT_CMD_KEY, BOOT_CMD_KEY_SIZE); memcpy((void *)cmd_hdr->addr, (void *)BOOT_CMD_KEY, sizeof(cmd_hdr->addr));
cmd_hdr->check = hgic_bootdl_cmd_check_val(hg->checksum_mode, (u8 *)&cmd_hdr->cmd, 11); cmd_hdr->check = hgic_bootdl_cmd_check_val(hg->checksum_mode, (u8 *)&cmd_hdr->cmd, 11);
} else { } else {
hgic_err("malloc skb failed!\n"); hgic_err("malloc skb failed!\n");

View file

@ -91,7 +91,7 @@ const struct sdio_device_id_t hgic_sdio_wdev_ids[] = {
#define SDIO_CAP_POLL(func) ((func)->card->host->caps & MMC_CAP_NEEDS_POLL) #define SDIO_CAP_POLL(func) ((func)->card->host->caps & MMC_CAP_NEEDS_POLL)
#define HOST_SPI_CRC(func, crc) (func)->card->host->use_spi_crc=crc #define HOST_SPI_CRC(func, crc) (func)->card->host->use_spi_crc=crc
//#define mmc_card_disable_cd(c) (1) #define mmc_card_disable_cd(c) (1)
#define hgic_card_disable_cd(func) mmc_card_disable_cd((func)->card) #define hgic_card_disable_cd(func) mmc_card_disable_cd((func)->card)
#define hgic_card_set_highspeed(func) mmc_card_set_highspeed((func)->card) #define hgic_card_set_highspeed(func) mmc_card_set_highspeed((func)->card)
#define hgic_host_is_spi(func) mmc_host_is_spi((func)->card->host) #define hgic_host_is_spi(func) mmc_host_is_spi((func)->card->host)