Ejemplo n.º 1
0
// c::ethoc_open
// file ethoc.c line 718
static signed int ethoc_open(struct net_device *dev)
{
  struct ethoc *priv;
  void *return_value_netdev_priv$1;
  return_value_netdev_priv$1=netdev_priv(dev);
  priv = (struct ethoc *)return_value_netdev_priv$1;
  ethoc_reset(priv);
  return 0;
}
Ejemplo n.º 2
0
static int ethoc_init(struct eth_device *dev)//, bd_t * bd)
{
	struct ethoc *priv = (struct ethoc *)dev->priv;
    //rt_sem_init(&sem_ack, "tx_ack", 1, RT_IPC_FLAG_FIFO);
    //rt_sem_init(&sem_lock, "eth_lock", 1, RT_IPC_FLAG_FIFO);

	priv->num_tx = 1;
	priv->num_rx = pktbufsrx;
	ethoc_write(dev, TX_BD_NUM/*tx_bd_num*/, priv->num_tx);
	ethoc_init_ring(dev);
	ethoc_reset(dev);
	return 0;
}
Ejemplo n.º 3
0
static int ethoc_init(struct eth_device *dev, bd_t * bd)
{
	struct ethoc *priv = (struct ethoc *)dev->priv;
	printf("ethoc\n");

	priv->num_tx = 1;
	priv->num_rx = PKTBUFSRX;
	ethoc_write(dev, TX_BD_NUM, priv->num_tx);
	ethoc_init_ring(dev);
	ethoc_reset(dev);

	return 0;
}
Ejemplo n.º 4
0
static int ethoc_init_common(struct ethoc *priv)
{
	int ret = 0;

	priv->num_tx = 1;
	priv->num_rx = PKTBUFSRX;
	ethoc_write(priv, TX_BD_NUM, priv->num_tx);
	ethoc_init_ring(priv);
	ethoc_reset(priv);

#ifdef CONFIG_PHYLIB
	ret = phy_startup(priv->phydev);
	if (ret) {
		printf("Could not initialize PHY %s\n",
		       priv->phydev->dev->name);
		return ret;
	}
#endif
	return ret;
}