Lines Matching refs:port_info
60 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_send() local
78 port_info->tx_desc_cur->td2 = ADDR_TO_PHY(packet); in sh_eth_send()
79 port_info->tx_desc_cur->td1 = len << 16; in sh_eth_send()
81 if (port_info->tx_desc_cur->td0 & TD_TDLE) in sh_eth_send()
82 port_info->tx_desc_cur->td0 = TD_TACT | TD_TFP | TD_TDLE; in sh_eth_send()
84 port_info->tx_desc_cur->td0 = TD_TACT | TD_TFP; in sh_eth_send()
86 flush_cache_wback(port_info->tx_desc_cur, sizeof(struct tx_desc_s)); in sh_eth_send()
95 invalidate_cache(port_info->tx_desc_cur, in sh_eth_send()
98 } while (port_info->tx_desc_cur->td0 & TD_TACT && timeout--); in sh_eth_send()
106 port_info->tx_desc_cur++; in sh_eth_send()
107 if (port_info->tx_desc_cur >= port_info->tx_desc_base + NUM_TX_DESC) in sh_eth_send()
108 port_info->tx_desc_cur = port_info->tx_desc_base; in sh_eth_send()
118 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_recv() local
122 invalidate_cache(port_info->rx_desc_cur, sizeof(struct rx_desc_s)); in sh_eth_recv()
123 if (!(port_info->rx_desc_cur->rd0 & RD_RACT)) { in sh_eth_recv()
125 if (!(port_info->rx_desc_cur->rd0 & RD_RFE)) { in sh_eth_recv()
126 len = port_info->rx_desc_cur->rd1 & 0xffff; in sh_eth_recv()
128 ADDR_TO_P2(port_info->rx_desc_cur->rd2); in sh_eth_recv()
134 if (port_info->rx_desc_cur->rd0 & RD_RDLE) in sh_eth_recv()
135 port_info->rx_desc_cur->rd0 = RD_RACT | RD_RDLE; in sh_eth_recv()
137 port_info->rx_desc_cur->rd0 = RD_RACT; in sh_eth_recv()
139 flush_cache_wback(port_info->rx_desc_cur, in sh_eth_recv()
143 port_info->rx_desc_cur++; in sh_eth_recv()
144 if (port_info->rx_desc_cur >= in sh_eth_recv()
145 port_info->rx_desc_base + NUM_RX_DESC) in sh_eth_recv()
146 port_info->rx_desc_cur = port_info->rx_desc_base; in sh_eth_recv()
191 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_tx_desc_init() local
198 port_info->tx_desc_alloc = in sh_eth_tx_desc_init()
200 if (!port_info->tx_desc_alloc) { in sh_eth_tx_desc_init()
206 flush_cache_wback((u32)port_info->tx_desc_alloc, alloc_desc_size); in sh_eth_tx_desc_init()
209 port_info->tx_desc_base = in sh_eth_tx_desc_init()
210 (struct tx_desc_s *)ADDR_TO_P2((u32)port_info->tx_desc_alloc); in sh_eth_tx_desc_init()
211 port_info->tx_desc_cur = port_info->tx_desc_base; in sh_eth_tx_desc_init()
214 for (cur_tx_desc = port_info->tx_desc_base, i = 0; i < NUM_TX_DESC; in sh_eth_tx_desc_init()
227 sh_eth_write(eth, ADDR_TO_PHY(port_info->tx_desc_base), TDLAR); in sh_eth_tx_desc_init()
229 sh_eth_write(eth, ADDR_TO_PHY(port_info->tx_desc_base), TDFAR); in sh_eth_tx_desc_init()
242 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_rx_desc_init() local
250 port_info->rx_desc_alloc = in sh_eth_rx_desc_init()
252 if (!port_info->rx_desc_alloc) { in sh_eth_rx_desc_init()
258 flush_cache_wback(port_info->rx_desc_alloc, alloc_desc_size); in sh_eth_rx_desc_init()
261 port_info->rx_desc_base = in sh_eth_rx_desc_init()
262 (struct rx_desc_s *)ADDR_TO_P2((u32)port_info->rx_desc_alloc); in sh_eth_rx_desc_init()
264 port_info->rx_desc_cur = port_info->rx_desc_base; in sh_eth_rx_desc_init()
270 port_info->rx_buf_alloc = in sh_eth_rx_desc_init()
272 if (!port_info->rx_buf_alloc) { in sh_eth_rx_desc_init()
278 port_info->rx_buf_base = (u8 *)ADDR_TO_P2((u32)port_info->rx_buf_alloc); in sh_eth_rx_desc_init()
281 for (cur_rx_desc = port_info->rx_desc_base, in sh_eth_rx_desc_init()
282 rx_buf = port_info->rx_buf_base, i = 0; in sh_eth_rx_desc_init()
294 sh_eth_write(eth, ADDR_TO_PHY(port_info->rx_desc_base), RDLAR); in sh_eth_rx_desc_init()
296 sh_eth_write(eth, ADDR_TO_PHY(port_info->rx_desc_base), RDFAR); in sh_eth_rx_desc_init()
304 free(port_info->rx_desc_alloc); in sh_eth_rx_desc_init()
305 port_info->rx_desc_alloc = NULL; in sh_eth_rx_desc_init()
314 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_tx_desc_free() local
316 if (port_info->tx_desc_alloc) { in sh_eth_tx_desc_free()
317 free(port_info->tx_desc_alloc); in sh_eth_tx_desc_free()
318 port_info->tx_desc_alloc = NULL; in sh_eth_tx_desc_free()
325 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_rx_desc_free() local
327 if (port_info->rx_desc_alloc) { in sh_eth_rx_desc_free()
328 free(port_info->rx_desc_alloc); in sh_eth_rx_desc_free()
329 port_info->rx_desc_alloc = NULL; in sh_eth_rx_desc_free()
332 if (port_info->rx_buf_alloc) { in sh_eth_rx_desc_free()
333 free(port_info->rx_buf_alloc); in sh_eth_rx_desc_free()
334 port_info->rx_buf_alloc = NULL; in sh_eth_rx_desc_free()
361 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_phy_config() local
362 struct eth_device *dev = port_info->dev; in sh_eth_phy_config()
367 port_info->phy_addr, dev, CONFIG_SH_ETHER_PHY_MODE); in sh_eth_phy_config()
368 port_info->phydev = phydev; in sh_eth_phy_config()
378 struct sh_eth_info *port_info = ð->port_info[port]; in sh_eth_config() local
379 struct eth_device *dev = port_info->dev; in sh_eth_config()
429 phy = port_info->phydev; in sh_eth_config()
553 eth->port_info[eth->port].phy_addr = CONFIG_SH_ETHER_PHY_ADDR; in sh_eth_initialize()
561 eth->port_info[eth->port].dev = dev; in sh_eth_initialize()