Lines Matching defs:edc
76 * Embed an 'struct edc' somewhere. Each time there is a soft or
86 struct edc {
98 static inline void edc_init(struct edc *edc)
100 edc->timestart = jiffies;
106 * @edc: pointer to error density counter.
119 * To use, embed a 'struct edc' somewhere, initialize it with
123 * if (edc_inc(&my->edc, MAX_ERRORS, MAX_TIMEFRAME))
129 static inline int edc_inc(struct edc *edc, u16 max_err, u16 timeframe)
134 if (now - edc->timestart > timeframe) {
135 edc->errorcount = 1;
136 edc->timestart = now;
137 } else if (++edc->errorcount > max_err) {
138 edc->errorcount = 0;
139 edc->timestart = now;
224 struct edc urb_edc; /* Error density counter */