Replaced ecdev_link_state() with ecdev_set_link(); added

ecdev_get_link().
This commit is contained in:
Florian Pose 2007-07-25 12:52:06 +00:00
parent eb5d5e2700
commit e5fc419e45
10 changed files with 34 additions and 15 deletions

1
NEWS
View File

@ -34,6 +34,7 @@ Changes in version 1.3.0:
- Replaced ecdev_register() and ecdev_unregister() with ecdev_offer() and
ecdev_withdraw(), respectively. The device modules now offer all their
devices to the master. The master then decides, which ones to register.
- Replaced ecdev_link_state() with ecdev_set_link(); added ecdev_get_link().
* All EEPROM write operations from user space are now blocking until
writing has finished. Appropriate error codes are returned.
* Implemented setting of the "Secondary slave address" (alias) via sysfs.

View File

@ -1435,7 +1435,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
if (tp->ecdev) {
void __iomem *ioaddr = tp->mmio_addr;
uint16_t state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
ecdev_link_state(tp->ecdev, state ? 1 : 0);
ecdev_set_link(tp->ecdev, state ? 1 : 0);
}
else {
if (tp->phys[0] >= 0) {

View File

@ -1439,7 +1439,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
if (tp->ecdev) {
void __iomem *ioaddr = tp->mmio_addr;
uint16_t state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
ecdev_link_state(tp->ecdev, state ? 1 : 0);
ecdev_set_link(tp->ecdev, state ? 1 : 0);
}
else {
if (tp->phys[0] >= 0) {

View File

@ -1440,7 +1440,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
if (tp->ecdev) {
void __iomem *ioaddr = tp->mmio_addr;
uint16_t state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
ecdev_link_state(tp->ecdev, state ? 1 : 0);
ecdev_set_link(tp->ecdev, state ? 1 : 0);
}
else {
if (tp->phys[0] >= 0) {

View File

@ -1439,7 +1439,7 @@ static void rtl_check_media (struct net_device *dev, unsigned int init_media)
if (tp->ecdev) {
void __iomem *ioaddr = tp->mmio_addr;
uint16_t state = RTL_R16(BasicModeStatus) & BMSR_LSTATUS;
ecdev_link_state(tp->ecdev, state ? 1 : 0);
ecdev_set_link(tp->ecdev, state ? 1 : 0);
}
else {
if (tp->phys[0] >= 0) {

View File

@ -1634,7 +1634,7 @@ static void e100_watchdog(unsigned long data)
/* mii library handles link maintenance tasks */
if (nic->ethercat) {
ecdev_link_state(nic->ecdev, mii_link_ok(&nic->mii) ? 1 : 0);
ecdev_set_link(nic->ecdev, mii_link_ok(&nic->mii) ? 1 : 0);
goto finish;
}

View File

@ -76,8 +76,8 @@ void ecdev_withdraw(ec_device_t *device);
int ecdev_open(ec_device_t *device);
void ecdev_close(ec_device_t *device);
void ecdev_receive(ec_device_t *device, const void *data, size_t size);
void ecdev_link_state(ec_device_t *device, uint8_t newstate);
uint8_t ecdev_link_up(ec_device_t *device);
void ecdev_set_link(ec_device_t *device, uint8_t state);
uint8_t ecdev_get_link(ec_device_t *device);
/*****************************************************************************/

View File

@ -2053,7 +2053,7 @@ static void nv_linkchange(struct net_device *dev)
if (np->ecdev) {
int link = nv_update_linkspeed(dev);
ecdev_link_state(np->ecdev, link);
ecdev_set_link(np->ecdev, link);
return;
}
@ -2985,7 +2985,7 @@ static int nv_open(struct net_device *dev)
nv_start_tx(dev);
if (np->ecdev) {
ecdev_link_state(np->ecdev, ret);
ecdev_set_link(np->ecdev, ret);
}
else {
netif_start_queue(dev);

View File

@ -2386,7 +2386,7 @@ static void nv_linkchange(struct net_device *dev)
if (np->ecdev) {
int link = nv_update_linkspeed(dev);
ecdev_link_state(np->ecdev, link);
ecdev_set_link(np->ecdev, link);
return;
}
@ -4220,7 +4220,7 @@ static int nv_open(struct net_device *dev)
nv_start_tx(dev);
if (np->ecdev) {
ecdev_link_state(np->ecdev, ret);
ecdev_set_link(np->ecdev, ret);
}
else {
netif_start_queue(dev);

View File

@ -301,9 +301,9 @@ void ecdev_receive(ec_device_t *device, /**< EtherCAT device */
\ingroup DeviceInterface
*/
void ecdev_link_state(ec_device_t *device, /**< EtherCAT device */
uint8_t state /**< new link state */
)
void ecdev_set_link(ec_device_t *device, /**< EtherCAT device */
uint8_t state /**< new link state */
)
{
if (unlikely(!device)) {
EC_WARN("ecdev_link_state: no device!\n");
@ -318,10 +318,28 @@ void ecdev_link_state(ec_device_t *device, /**< EtherCAT device */
/*****************************************************************************/
/**
Reads the link state.
\ingroup DeviceInterface
*/
uint8_t ecdev_get_link(ec_device_t *device /**< EtherCAT device */)
{
if (unlikely(!device)) {
EC_WARN("ecdev_link_state: no device!\n");
return 0;
}
return device->link_state;
}
/*****************************************************************************/
/** \cond */
EXPORT_SYMBOL(ecdev_receive);
EXPORT_SYMBOL(ecdev_link_state);
EXPORT_SYMBOL(ecdev_get_link);
EXPORT_SYMBOL(ecdev_set_link);
/** \endcond */