fix compilation and errors with newer versions of the kernel
This commit is contained in:
parent
2c7206d671
commit
15e9a9a80e
4 changed files with 12 additions and 7 deletions
|
@ -459,7 +459,12 @@ static struct hgicf_vif *hgicf_create_iface(struct hgicf_wdev *hg)
|
||||||
vif->hg = hg;
|
vif->hg = hg;
|
||||||
vif->state = 0;
|
vif->state = 0;
|
||||||
ndev->needed_headroom += (hg->bus->drv_tx_headroom + sizeof(struct hgic_frm_hdr2));
|
ndev->needed_headroom += (hg->bus->drv_tx_headroom + sizeof(struct hgic_frm_hdr2));
|
||||||
|
|
||||||
|
#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) {
|
||||||
free_netdev(ndev);
|
free_netdev(ndev);
|
||||||
|
@ -507,11 +512,7 @@ static int hgicf_rx_data(void *hgobj, struct sk_buff *skb, int len)
|
||||||
}
|
}
|
||||||
skb_pull(skb, sizeof(struct hgic_frm_hdr2));
|
skb_pull(skb, sizeof(struct hgic_frm_hdr2));
|
||||||
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);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case HGIC_HDR_TYPE_CMD:
|
case HGIC_HDR_TYPE_CMD:
|
||||||
case HGIC_HDR_TYPE_CMD2:
|
case HGIC_HDR_TYPE_CMD2:
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
#include "hgicf.h"
|
#include "hgicf.h"
|
||||||
#include "cfg.h"
|
#include "cfg.h"
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 16, 0)
|
||||||
|
#define PDE_DATA(inode) pde_data(inode)
|
||||||
|
#endif
|
||||||
|
|
||||||
static int hgicf_signal_show(struct seq_file *seq, void *v)
|
static int hgicf_signal_show(struct seq_file *seq, void *v)
|
||||||
{
|
{
|
||||||
struct hgicf_wdev *hg = (struct hgicf_wdev *)seq->private;
|
struct hgicf_wdev *hg = (struct hgicf_wdev *)seq->private;
|
||||||
|
|
|
@ -266,7 +266,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");
|
||||||
|
|
|
@ -80,7 +80,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)
|
||||||
|
|
Loading…
Reference in a new issue