mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-02-05 19:39:50 +08:00
IF's im rtl8139too-Treiber vereinfacht und kein Polling mehr.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -71,7 +71,7 @@ typedef struct EtherCAT_command
|
||||
|
||||
EtherCAT_command_state_t state; /**< Zustand des Kommandos (bereit, gesendet, etc...) */
|
||||
unsigned char index; /**< Kommando-Index, mit der das Kommando gesendet wurde (wird
|
||||
vom Master beim Senden gesetzt. */
|
||||
vom Master beim Senden gesetzt. */
|
||||
unsigned int working_counter; /**< Working-Counter bei Empfang (wird vom Master gesetzt) */
|
||||
|
||||
unsigned char data[ECAT_FRAME_BUFFER_SIZE]; /**< Kommandodaten */
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
#include "ec_device.h"
|
||||
#include "ec_dbg.h"
|
||||
|
||||
extern irqreturn_t rtl8139_interrupt(int, void *, struct pt_regs *);
|
||||
extern int rtl8139_poll(struct net_device *, int *);
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
/**
|
||||
@@ -44,7 +41,7 @@ void EtherCAT_device_init(EtherCAT_device_t *ecd)
|
||||
ecd->intr_cnt = 0;
|
||||
ecd->state = ECAT_DS_READY;
|
||||
ecd->rx_data_length = 0;
|
||||
ecd->lock = NULL;
|
||||
ecd->isr = NULL;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -293,21 +290,7 @@ int EtherCAT_device_receive(EtherCAT_device_t *ecd,
|
||||
|
||||
void EtherCAT_device_call_isr(EtherCAT_device_t *ecd)
|
||||
{
|
||||
int budget;
|
||||
|
||||
budget = 1; /* Einen Frame empfangen */
|
||||
|
||||
rtl8139_interrupt(0, ecd->dev, NULL);
|
||||
ecd->dev->quota = 1;
|
||||
rtl8139_poll(ecd->dev, &budget);
|
||||
|
||||
/* HM
|
||||
if (budget != 0)
|
||||
{
|
||||
EC_DBG(KERN_ERR "EtherCAT: Warning - Budget is %d!\n",
|
||||
budget);
|
||||
}
|
||||
*/
|
||||
if (ecd->isr) ecd->isr(0, ecd->dev, NULL);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
@@ -336,7 +319,6 @@ void EtherCAT_device_debug(EtherCAT_device_t *ecd)
|
||||
EC_DBG(KERN_DEBUG "Receive buffer: %X\n", (unsigned) ecd->rx_data);
|
||||
EC_DBG(KERN_DEBUG "Receive buffer fill state: %u/%u\n",
|
||||
(unsigned) ecd->rx_data_length, ECAT_FRAME_BUFFER_SIZE);
|
||||
EC_DBG(KERN_DEBUG "Lock: %X\n", (unsigned) ecd->lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -353,3 +335,4 @@ EXPORT_SYMBOL(EtherCAT_device_close);
|
||||
EXPORT_SYMBOL(EtherCAT_device_clear);
|
||||
EXPORT_SYMBOL(EtherCAT_device_debug);
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#ifndef _EC_DEVICE_H_
|
||||
#define _EC_DEVICE_H_
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
#include "ec_globals.h"
|
||||
|
||||
/**
|
||||
@@ -34,9 +36,6 @@ typedef enum
|
||||
}
|
||||
EtherCAT_device_state_t;
|
||||
|
||||
#define ECAT_BUS_TIME(ecd_ptr) ((((ecd_ptr)->rx_time - \
|
||||
(ecd_ptr)->tx_time) * 1000) / cpu_khz)
|
||||
|
||||
/***************************************************************/
|
||||
|
||||
/**
|
||||
@@ -63,7 +62,7 @@ typedef struct
|
||||
empfangene Rahmen */
|
||||
volatile unsigned int rx_data_length; /**< Länge des zuletzt
|
||||
empfangenen Rahmens */
|
||||
spinlock_t *lock; /**< Zeiger auf das Spinlock des net_devices */
|
||||
irqreturn_t (*isr)(int, void *, struct pt_regs *); /**< Adresse der ISR */
|
||||
}
|
||||
EtherCAT_device_t;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user