Interface bus mode can be selected in .config (make menuconfig etc.)+#if defined(CONFIG_WIZNET_BUS_DIRECT)Looks like you don't have to make such decisions at compile-time. Since it is a platform driver, better supply this through platform_data instead.
+#define detect_bus_mode(priv, mem_size) do {} while(0)
+#define read_reg_u16 read_u16_direct
+#define write_reg_u16 write_u16_direct
+
+#elif defined(CONFIG_WIZNET_BUS_INDIRECT)
+#define detect_bus_mode(priv, mem_size) do {} while(0)
+#define read_reg_u16 read_u16_indirect
+#define write_reg_u16 write_u16_indirect
Please implement phylib to properly report the link state to the networking stack and ethtool.This chip don't allow any access to phy interface, it completely hidden for host processor.
+static irqreturn_t w5300_detect_link(int irq, void *ndev_instance)Isn't it enough for networking stack?
+{
+ struct net_device *ndev = ndev_instance;
+ struct w5300_private *priv = netdev_priv(ndev);
+
+ if (netif_running(ndev)) {
+ if (gpio_get_value(priv->link) == 0)
+ netif_carrier_off(ndev);
+ else
+ netif_carrier_on(ndev);
+ }
+
+ return IRQ_HANDLED;
+}
Allow platform_data to pass a valid MAC address to this driver instead of defaulting to random unconditionnaly.Do you mean - create .h file in /include/linux/platform_data/ ?