mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-03 00:52:02 +07:00
[PATCH] orinoco: remove debug buffer code and userspace include support
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
65b1fe7df7
commit
754b1364e7
@ -121,12 +121,6 @@ void hermes_struct_init(hermes_t *hw, void __iomem *address, int reg_spacing)
|
|||||||
hw->iobase = address;
|
hw->iobase = address;
|
||||||
hw->reg_spacing = reg_spacing;
|
hw->reg_spacing = reg_spacing;
|
||||||
hw->inten = 0x0;
|
hw->inten = 0x0;
|
||||||
|
|
||||||
#ifdef HERMES_DEBUG_BUFFER
|
|
||||||
hw->dbufp = 0;
|
|
||||||
memset(&hw->dbuf, 0xff, sizeof(hw->dbuf));
|
|
||||||
memset(&hw->profile, 0, sizeof(hw->profile));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int hermes_init(hermes_t *hw)
|
int hermes_init(hermes_t *hw)
|
||||||
@ -347,19 +341,6 @@ static int hermes_bap_seek(hermes_t *hw, int bap, u16 id, u16 offset)
|
|||||||
reg = hermes_read_reg(hw, oreg);
|
reg = hermes_read_reg(hw, oreg);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HERMES_DEBUG_BUFFER
|
|
||||||
hw->profile[HERMES_BAP_BUSY_TIMEOUT - k]++;
|
|
||||||
|
|
||||||
if (k < HERMES_BAP_BUSY_TIMEOUT) {
|
|
||||||
struct hermes_debug_entry *e =
|
|
||||||
&hw->dbuf[(hw->dbufp++) % HERMES_DEBUG_BUFSIZE];
|
|
||||||
e->bap = bap;
|
|
||||||
e->id = id;
|
|
||||||
e->offset = offset;
|
|
||||||
e->cycles = HERMES_BAP_BUSY_TIMEOUT - k;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (reg & HERMES_OFFSET_BUSY)
|
if (reg & HERMES_OFFSET_BUSY)
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
|
|
||||||
|
@ -328,16 +328,6 @@ struct hermes_multicast {
|
|||||||
u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
|
u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
|
||||||
} __attribute__ ((packed));
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
// #define HERMES_DEBUG_BUFFER 1
|
|
||||||
#define HERMES_DEBUG_BUFSIZE 4096
|
|
||||||
struct hermes_debug_entry {
|
|
||||||
int bap;
|
|
||||||
u16 id, offset;
|
|
||||||
int cycles;
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef __KERNEL__
|
|
||||||
|
|
||||||
/* Timeouts */
|
/* Timeouts */
|
||||||
#define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */
|
#define HERMES_BAP_BUSY_TIMEOUT (10000) /* In iterations of ~1us */
|
||||||
|
|
||||||
@ -347,14 +337,7 @@ typedef struct hermes {
|
|||||||
int reg_spacing;
|
int reg_spacing;
|
||||||
#define HERMES_16BIT_REGSPACING 0
|
#define HERMES_16BIT_REGSPACING 0
|
||||||
#define HERMES_32BIT_REGSPACING 1
|
#define HERMES_32BIT_REGSPACING 1
|
||||||
|
|
||||||
u16 inten; /* Which interrupts should be enabled? */
|
u16 inten; /* Which interrupts should be enabled? */
|
||||||
|
|
||||||
#ifdef HERMES_DEBUG_BUFFER
|
|
||||||
struct hermes_debug_entry dbuf[HERMES_DEBUG_BUFSIZE];
|
|
||||||
unsigned long dbufp;
|
|
||||||
unsigned long profile[HERMES_BAP_BUSY_TIMEOUT+1];
|
|
||||||
#endif
|
|
||||||
} hermes_t;
|
} hermes_t;
|
||||||
|
|
||||||
/* Register access convenience macros */
|
/* Register access convenience macros */
|
||||||
@ -462,21 +445,4 @@ static inline int hermes_write_wordrec(hermes_t *hw, int bap, u16 rid, u16 word)
|
|||||||
return HERMES_WRITE_RECORD(hw, bap, rid, &rec);
|
return HERMES_WRITE_RECORD(hw, bap, rid, &rec);
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* ! __KERNEL__ */
|
|
||||||
|
|
||||||
/* These are provided for the benefit of userspace drivers and testing programs
|
|
||||||
which use ioperm() or iopl() */
|
|
||||||
|
|
||||||
#define hermes_read_reg(base, off) (inw((base) + (off)))
|
|
||||||
#define hermes_write_reg(base, off, val) (outw((val), (base) + (off)))
|
|
||||||
|
|
||||||
#define hermes_read_regn(base, name) (hermes_read_reg((base), HERMES_##name))
|
|
||||||
#define hermes_write_regn(base, name, val) (hermes_write_reg((base), HERMES_##name, (val)))
|
|
||||||
|
|
||||||
/* Note that for the next two, the count is in 16-bit words, not bytes */
|
|
||||||
#define hermes_read_data(base, off, buf, count) (insw((base) + (off), (buf), (count)))
|
|
||||||
#define hermes_write_data(base, off, buf, count) (outsw((base) + (off), (buf), (count)))
|
|
||||||
|
|
||||||
#endif /* ! __KERNEL__ */
|
|
||||||
|
|
||||||
#endif /* _HERMES_H */
|
#endif /* _HERMES_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user