hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/net/ethernet/xilinx/ll_temac.h
....@@ -334,6 +334,9 @@
334334
335335 /* Connection to PHY device */
336336 struct device_node *phy_node;
337
+ /* For non-device-tree devices */
338
+ char phy_name[MII_BUS_ID_SIZE + 3];
339
+ phy_interface_t phy_interface;
337340
338341 /* MDIO bus data */
339342 struct mii_bus *mii_bus; /* MII bus reference */
....@@ -344,8 +347,10 @@
344347 #ifdef CONFIG_PPC_DCR
345348 dcr_host_t sdma_dcrs;
346349 #endif
347
- u32 (*dma_in)(struct temac_local *, int);
348
- void (*dma_out)(struct temac_local *, int, u32);
350
+ u32 (*temac_ior)(struct temac_local *lp, int offset);
351
+ void (*temac_iow)(struct temac_local *lp, int offset, u32 value);
352
+ u32 (*dma_in)(struct temac_local *lp, int reg);
353
+ void (*dma_out)(struct temac_local *lp, int reg, u32 value);
349354
350355 int tx_irq;
351356 int rx_irq;
....@@ -353,7 +358,10 @@
353358
354359 struct sk_buff **rx_skb;
355360 spinlock_t rx_lock;
356
- struct mutex indirect_mutex;
361
+ /* For synchronization of indirect register access. Must be
362
+ * shared mutex between interfaces in same TEMAC block.
363
+ */
364
+ spinlock_t *indirect_lock;
357365 u32 options; /* Current options word */
358366 int last_link;
359367 unsigned int temac_features;
....@@ -361,24 +369,37 @@
361369 /* Buffer descriptors */
362370 struct cdmac_bd *tx_bd_v;
363371 dma_addr_t tx_bd_p;
372
+ u32 tx_bd_num;
364373 struct cdmac_bd *rx_bd_v;
365374 dma_addr_t rx_bd_p;
375
+ u32 rx_bd_num;
366376 int tx_bd_ci;
367
- int tx_bd_next;
368377 int tx_bd_tail;
369378 int rx_bd_ci;
379
+ int rx_bd_tail;
380
+
381
+ /* DMA channel control setup */
382
+ u8 coalesce_count_tx;
383
+ u8 coalesce_delay_tx;
384
+ u8 coalesce_count_rx;
385
+ u8 coalesce_delay_rx;
386
+
387
+ struct delayed_work restart_work;
370388 };
371389
390
+/* Wrappers for temac_ior()/temac_iow() function pointers above */
391
+#define temac_ior(lp, o) ((lp)->temac_ior(lp, o))
392
+#define temac_iow(lp, o, v) ((lp)->temac_iow(lp, o, v))
393
+
372394 /* xilinx_temac.c */
373
-u32 temac_ior(struct temac_local *lp, int offset);
374
-void temac_iow(struct temac_local *lp, int offset, u32 value);
375395 int temac_indirect_busywait(struct temac_local *lp);
376396 u32 temac_indirect_in32(struct temac_local *lp, int reg);
397
+u32 temac_indirect_in32_locked(struct temac_local *lp, int reg);
377398 void temac_indirect_out32(struct temac_local *lp, int reg, u32 value);
378
-
399
+void temac_indirect_out32_locked(struct temac_local *lp, int reg, u32 value);
379400
380401 /* xilinx_temac_mdio.c */
381
-int temac_mdio_setup(struct temac_local *lp, struct device_node *np);
402
+int temac_mdio_setup(struct temac_local *lp, struct platform_device *pdev);
382403 void temac_mdio_teardown(struct temac_local *lp);
383404
384405 #endif /* XILINX_LL_TEMAC_H */