+static int hbg_net_set_mac_address(struct net_device *dev, void *addr)How does the core pass you an invalid MAC address?
+{
+ struct hbg_priv *priv = netdev_priv(dev);
+ u8 *mac_addr;
+
+ mac_addr = ((struct sockaddr *)addr)->sa_data;
+ if (ether_addr_equal(dev->dev_addr, mac_addr))
+ return 0;
+
+ if (!is_valid_ether_addr(mac_addr))
+ return -EADDRNOTAVAIL;
+static int hbg_net_change_mtu(struct net_device *dev, int new_mtu)You just need to set dev->min_mtu and dev->max_mtu, and the core will
+{
+ struct hbg_priv *priv = netdev_priv(dev);
+ bool is_opened = hbg_nic_is_open(priv);
+ u32 frame_len;
+
+ if (new_mtu == dev->mtu)
+ return 0;
+
+ if (new_mtu < priv->dev_specs.min_mtu || new_mtu > priv->dev_specs.max_mtu)
+ return -EINVAL;
do this validation for you.
+ dev_info(&priv->pdev->dev,dev_dbg() Don't spam the log for normal operations.
+ "change mtu from %u to %u\n", dev->mtu, new_mtu);