Advertisement
Guest User

fix-yt6801-build

a guest
Apr 19th, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 5.04 KB | Software | 0 0
  1. From 44190f66a71c67c49e070ab78cb03a0efe9eecef Mon Sep 17 00:00:00 2001
  2. From: Benjamin ROBIN <dev@benjarobin.fr>
  3. Date: Fri, 19 Apr 2024 19:51:50 +0200
  4. Subject: [PATCH] Fix build
  5.  
  6. ---
  7. src/fuxi-gmac-common.c  |  4 ++--
  8.  src/fuxi-gmac-ethtool.c | 42 ++++++++++++++++++++---------------------
  9.  2 files changed, 22 insertions(+), 24 deletions(-)
  10.  
  11. diff --git a/src/fuxi-gmac-common.c b/src/fuxi-gmac-common.c
  12. index 4b625f8..86b55a7 100644
  13. --- a/src/fuxi-gmac-common.c
  14. +++ b/src/fuxi-gmac-common.c
  15. @@ -76,8 +76,8 @@ static void fxgmac_default_config(struct fxgmac_pdata *pdata)
  16.      // default to magic
  17.      pdata->expansion.wol = WAKE_MAGIC;
  18.  
  19. -    strlcpy(pdata->drv_name, FXGMAC_DRV_NAME, sizeof(pdata->drv_name));
  20. -    strlcpy(pdata->drv_ver, FXGMAC_DRV_VERSION, sizeof(pdata->drv_ver));
  21. +    strscpy(pdata->drv_name, FXGMAC_DRV_NAME, sizeof(pdata->drv_name));
  22. +    strscpy(pdata->drv_ver, FXGMAC_DRV_VERSION, sizeof(pdata->drv_ver));
  23.  
  24.      printk("FXGMAC_DRV_NAME:%s, FXGMAC_DRV_VERSION:%s\n", FXGMAC_DRV_NAME, FXGMAC_DRV_VERSION);
  25.  }
  26. diff --git a/src/fuxi-gmac-ethtool.c b/src/fuxi-gmac-ethtool.c
  27. index bdd1228..f07181f 100644
  28. --- a/src/fuxi-gmac-ethtool.c
  29. +++ b/src/fuxi-gmac-ethtool.c
  30. @@ -111,10 +111,9 @@ static void fxgmac_ethtool_get_drvinfo(struct net_device *netdev,
  31.      u32 ver = pdata->hw_feat.version;
  32.      u32 sver, devid, userver;
  33.  
  34. -    strlcpy(drvinfo->driver, pdata->drv_name, sizeof(drvinfo->driver));
  35. -    strlcpy(drvinfo->version, pdata->drv_ver, sizeof(drvinfo->version));
  36. -    strlcpy(drvinfo->bus_info, dev_name(pdata->dev),
  37. -    sizeof(drvinfo->bus_info));
  38. +    strscpy(drvinfo->driver, pdata->drv_name, sizeof(drvinfo->driver));
  39. +    strscpy(drvinfo->version, pdata->drv_ver, sizeof(drvinfo->version));
  40. +    strscpy(drvinfo->bus_info, dev_name(pdata->dev), sizeof(drvinfo->bus_info));
  41.      /*
  42.      * D|DEVID: Indicates the Device family
  43.      * U|USERVER: User-defined Version
  44. @@ -277,8 +276,7 @@ static void fxgmac_get_reta(struct fxgmac_pdata *pdata, u32 *indir)
  45.         indir[i] = pdata->rss_table[i] & rss_m;
  46.  }
  47.  
  48. -static int fxgmac_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
  49. -             u8 *hfunc)
  50. +static int fxgmac_get_rxfh(struct net_device *netdev, struct ethtool_rxfh_param *rxfh)
  51.  {
  52.      struct fxgmac_pdata *pdata = netdev_priv(netdev);
  53.  
  54. @@ -287,30 +285,30 @@ static int fxgmac_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
  55.      ETH_RSS_HASH_XOR        __ETH_RSS_HASH(XOR)
  56.      ETH_RSS_HASH_CRC32      __ETH_RSS_HASH(CRC32)
  57.      */
  58. -    if (hfunc)
  59. +    if (rxfh->hfunc)
  60.      {
  61. -       //*hfunc = ETH_RSS_HASH_XOR;
  62. -       *hfunc = ETH_RSS_HASH_TOP;
  63. +       rxfh->hfunc = ETH_RSS_HASH_TOP;
  64.         DPRINTK("fxmac, get_rxfh for hash function\n");
  65.      }
  66.  
  67. -    if (indir)
  68. +    if (rxfh->indir)
  69.      {
  70. -       fxgmac_get_reta(pdata, indir);
  71. +       fxgmac_get_reta(pdata, rxfh->indir);
  72.         DPRINTK("fxmac, get_rxfh for indirection tab\n");
  73.      }
  74.  
  75. -    if (key)
  76. +    if (rxfh->key)
  77.      {
  78. -       memcpy(key, pdata->rss_key, fxgmac_get_rxfh_key_size(netdev));
  79. +       memcpy(rxfh->key, pdata->rss_key, fxgmac_get_rxfh_key_size(netdev));
  80.         DPRINTK("fxmac, get_rxfh  for hash key\n");
  81.      }
  82.  
  83.      return 0;
  84.  }
  85.  
  86. -static int fxgmac_set_rxfh(struct net_device *netdev, const u32 *indir,
  87. -             const u8 *key, const u8 hfunc)
  88. +static int fxgmac_set_rxfh(struct net_device *netdev,
  89. +                           struct ethtool_rxfh_param *rxfh,
  90. +                           struct netlink_ext_ack *extack)
  91.  {
  92.      struct fxgmac_pdata *pdata = netdev_priv(netdev);
  93.      struct fxgmac_hw_ops *hw_ops = &pdata->hw_ops;
  94. @@ -318,13 +316,13 @@ static int fxgmac_set_rxfh(struct net_device *netdev, const u32 *indir,
  95.      u32 reta_entries = fxgmac_rss_indir_size(netdev);
  96.      int max_queues = FXGMAC_MAX_DMA_CHANNELS;
  97.  
  98. -    DPRINTK("fxmac, set_rxfh callin, indir=%lx, key=%lx, func=%02x\n", (unsigned long)indir, (unsigned long)key, hfunc);
  99. +    DPRINTK("fxmac, set_rxfh callin, indir=%lx, key=%lx, func=%02x\n", (unsigned long)rxfh->indir, (unsigned long)rxfh->key, rxfh->hfunc);
  100.  
  101. -    if (hfunc)
  102. +    if (rxfh->hfunc)
  103.         return -EINVAL;
  104.  
  105.      /* Fill out the redirection table */
  106. -    if (indir) {
  107. +    if (rxfh->indir) {
  108.  #if FXGMAC_MSIX_CH0RXDIS_EN
  109.         max_queues = max_queues; // kill warning
  110.         reta_entries = reta_entries;
  111. @@ -334,19 +332,19 @@ static int fxgmac_set_rxfh(struct net_device *netdev, const u32 *indir,
  112.  #else
  113.         /* double check user input. */
  114.         for (i = 0; i < reta_entries; i++)
  115. -           if (indir[i] >= max_queues)
  116. +           if (rxfh->indir[i] >= max_queues)
  117.                 return -EINVAL;
  118.  
  119.         for (i = 0; i < reta_entries; i++)
  120. -           pdata->rss_table[i] = indir[i];
  121. +           pdata->rss_table[i] = rxfh->indir[i];
  122.  
  123.         hw_ops->write_rss_lookup_table(pdata);
  124.  #endif
  125.      }
  126.  
  127.      /* Fill out the rss hash key */
  128. -    if (FXGMAC_RSS_HASH_KEY_LINUX && key) {
  129. -       hw_ops->set_rss_hash_key(pdata, key);
  130. +    if (FXGMAC_RSS_HASH_KEY_LINUX && rxfh->key) {
  131. +       hw_ops->set_rss_hash_key(pdata, rxfh->key);
  132.      }
  133.  
  134.      return 0;
  135. --
  136. 2.44.0
  137.  
  138.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement