| .. | .. |
|---|
| 334 | 334 | |
|---|
| 335 | 335 | /* Connection to PHY device */ |
|---|
| 336 | 336 | 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; |
|---|
| 337 | 340 | |
|---|
| 338 | 341 | /* MDIO bus data */ |
|---|
| 339 | 342 | struct mii_bus *mii_bus; /* MII bus reference */ |
|---|
| .. | .. |
|---|
| 344 | 347 | #ifdef CONFIG_PPC_DCR |
|---|
| 345 | 348 | dcr_host_t sdma_dcrs; |
|---|
| 346 | 349 | #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); |
|---|
| 349 | 354 | |
|---|
| 350 | 355 | int tx_irq; |
|---|
| 351 | 356 | int rx_irq; |
|---|
| .. | .. |
|---|
| 353 | 358 | |
|---|
| 354 | 359 | struct sk_buff **rx_skb; |
|---|
| 355 | 360 | 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; |
|---|
| 357 | 365 | u32 options; /* Current options word */ |
|---|
| 358 | 366 | int last_link; |
|---|
| 359 | 367 | unsigned int temac_features; |
|---|
| .. | .. |
|---|
| 361 | 369 | /* Buffer descriptors */ |
|---|
| 362 | 370 | struct cdmac_bd *tx_bd_v; |
|---|
| 363 | 371 | dma_addr_t tx_bd_p; |
|---|
| 372 | + u32 tx_bd_num; |
|---|
| 364 | 373 | struct cdmac_bd *rx_bd_v; |
|---|
| 365 | 374 | dma_addr_t rx_bd_p; |
|---|
| 375 | + u32 rx_bd_num; |
|---|
| 366 | 376 | int tx_bd_ci; |
|---|
| 367 | | - int tx_bd_next; |
|---|
| 368 | 377 | int tx_bd_tail; |
|---|
| 369 | 378 | 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; |
|---|
| 370 | 388 | }; |
|---|
| 371 | 389 | |
|---|
| 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 | + |
|---|
| 372 | 394 | /* 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); |
|---|
| 375 | 395 | int temac_indirect_busywait(struct temac_local *lp); |
|---|
| 376 | 396 | u32 temac_indirect_in32(struct temac_local *lp, int reg); |
|---|
| 397 | +u32 temac_indirect_in32_locked(struct temac_local *lp, int reg); |
|---|
| 377 | 398 | 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); |
|---|
| 379 | 400 | |
|---|
| 380 | 401 | /* 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); |
|---|
| 382 | 403 | void temac_mdio_teardown(struct temac_local *lp); |
|---|
| 383 | 404 | |
|---|
| 384 | 405 | #endif /* XILINX_LL_TEMAC_H */ |
|---|