mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
NTB: switchtec: Add link event notifier callback
In order for the Switchtec NTB code to handle link change events we create a notifier callback in the switchtec code which gets called whenever an appropriate event interrupt occurs. In order to preserve userspace's ability to follow these events, we compare the event count with a stored copy from last time we checked. Signed-off-by: Logan Gunthorpe <logang@deltatee.com> Reviewed-by: Stephen Bates <sbates@raithlin.com> Reviewed-by: Kurt Schwemmer <kurt.schwemmer@microsemi.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
This commit is contained in:
parent
c082b04c9d
commit
48c302dc8f
2 changed files with 55 additions and 0 deletions
|
@ -353,6 +353,10 @@ struct switchtec_dev {
|
|||
|
||||
wait_queue_head_t event_wq;
|
||||
atomic_t event_cnt;
|
||||
|
||||
struct work_struct link_event_work;
|
||||
void (*link_notifier)(struct switchtec_dev *stdev);
|
||||
u8 link_event_count[SWITCHTEC_MAX_PFF_CSR];
|
||||
};
|
||||
|
||||
static inline struct switchtec_dev *to_stdev(struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue