lan91c111.h
来自「AMLOGIC DPF source code」· C头文件 代码 · 共 107 行
H
107 行
/*******************************************************************
*
* Copyright C 2005 by Amlogic, Inc. All Rights Reserved.
*
* Description:
*
* Author: Eric Knudstrup
* Created: Wed Jan 5 13:42:57 2005
*
*******************************************************************/
#ifndef LAN91C111_H
#define LAN91C111_H
struct l91_if;
/*;emacs generated header for file lan91c111.c. Global function declarations only. */
/**
* Set the interrupt pin(VD0~VD7) for LAN91C111
*
* @param [in] input_irq_pin The GPIO pin which will receive the
* interrupt from LAN91c111, triggered by high level.
*/
extern void
l91_set_irq(u8_t interrupt_irq_pin);
/**
* Put a LAN91C111 interface into MAC promiscuous mode
*
* @param [in] netif Network interface to operate on.
* @param [in] enable If TRUE, then enable promiscuos mode, otherwise disable
*/
extern void
l91_set_promisc(struct netif *netif, int enable);
/**
* Put a LAN91C111 interface into MAC loopback
*
* @param [in] netif Network interface to operate on.
* @param [in] enable If TRUE, then enable loopback, otherwise disable
*/
extern void
l91_set_loopback(struct netif *netif, int enable);
/**
* Allocate, initialize, and attach a LAN91C111 ethernet interface.
*
* @param [out] netif A pointer to a netif describing the new interface
* @param [in] base_address Where the chip is located in the memory space.
* @param [in] ipaddr IP Address to assign to the interface. If this is
NULL, dhcp will be started.
* @param [in] netmask Network mask for this interface.
* @param [in] gw Default gateway
*
* @returns ERR_MEM if memory couldn't be allocated, otherwise ERR_OK.
*/
extern err_t
l91_create(struct netif **netif,
unsigned short *base_address,
struct ip_addr *ipaddr,
struct ip_addr *netmask,
struct ip_addr *gw);
extern void
l91_test_output(struct netif *netif, struct pbuf *pbuf);
/*
. Function: l91_update_multi(struct netif *netif)
. Purpose:
. This sets the internal hardware table to filter out unwanted multicast
. packets before they take up memory.
.
. The SMC chip uses a hash table where the high 6 bits of the CRC of
. address are the offset into the table. If that bit is 1, then the
. multicast packet is accepted. Otherwise, it's dropped silently.
.
. To use the 6 bits as an offset into the table, the high 3 bits are the
. number of the 8 bit register, while the low 3 bits are the bit within
. that register.
.
. This routine is based very heavily on the one provided by Peter Cammaert.
*/
extern void l91_update_multi(struct netif *netif);
/**
* Prevent receiving and transmitting packets on a L91C111
* ethernet interface.
* @param [in] netif Interface to operate on
*/
extern void l91_stop(struct netif *netif);
/**
* Allow receiving and transmitting packets on a L91C111
* ethernet interface.
* @param [in] netif Interface to operate on
*/
extern void l91_start(struct netif *netif);
extern inline u16_t get_reg(struct l91_if *l91_if, int regno);
extern void dump_l91(struct l91_if *l91_if);
/*;end emacs generated header for file lan91c111.c. Global function declarations only. */
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?