| .. | .. |
|---|
| 4 | 4 | #include "hnae3.h" |
|---|
| 5 | 5 | #include "hns3_enet.h" |
|---|
| 6 | 6 | |
|---|
| 7 | | -static |
|---|
| 8 | | -int hns3_dcbnl_ieee_getets(struct net_device *ndev, struct ieee_ets *ets) |
|---|
| 7 | +static int hns3_dcbnl_ieee_getets(struct net_device *ndev, struct ieee_ets *ets) |
|---|
| 9 | 8 | { |
|---|
| 10 | 9 | struct hnae3_handle *h = hns3_get_handle(ndev); |
|---|
| 10 | + |
|---|
| 11 | + if (hns3_nic_resetting(ndev)) |
|---|
| 12 | + return -EBUSY; |
|---|
| 11 | 13 | |
|---|
| 12 | 14 | if (h->kinfo.dcb_ops->ieee_getets) |
|---|
| 13 | 15 | return h->kinfo.dcb_ops->ieee_getets(h, ets); |
|---|
| .. | .. |
|---|
| 15 | 17 | return -EOPNOTSUPP; |
|---|
| 16 | 18 | } |
|---|
| 17 | 19 | |
|---|
| 18 | | -static |
|---|
| 19 | | -int hns3_dcbnl_ieee_setets(struct net_device *ndev, struct ieee_ets *ets) |
|---|
| 20 | +static int hns3_dcbnl_ieee_setets(struct net_device *ndev, struct ieee_ets *ets) |
|---|
| 20 | 21 | { |
|---|
| 21 | 22 | struct hnae3_handle *h = hns3_get_handle(ndev); |
|---|
| 23 | + |
|---|
| 24 | + if (hns3_nic_resetting(ndev)) |
|---|
| 25 | + return -EBUSY; |
|---|
| 22 | 26 | |
|---|
| 23 | 27 | if (h->kinfo.dcb_ops->ieee_setets) |
|---|
| 24 | 28 | return h->kinfo.dcb_ops->ieee_setets(h, ets); |
|---|
| .. | .. |
|---|
| 26 | 30 | return -EOPNOTSUPP; |
|---|
| 27 | 31 | } |
|---|
| 28 | 32 | |
|---|
| 29 | | -static |
|---|
| 30 | | -int hns3_dcbnl_ieee_getpfc(struct net_device *ndev, struct ieee_pfc *pfc) |
|---|
| 33 | +static int hns3_dcbnl_ieee_getpfc(struct net_device *ndev, struct ieee_pfc *pfc) |
|---|
| 31 | 34 | { |
|---|
| 32 | 35 | struct hnae3_handle *h = hns3_get_handle(ndev); |
|---|
| 36 | + |
|---|
| 37 | + if (hns3_nic_resetting(ndev)) |
|---|
| 38 | + return -EBUSY; |
|---|
| 33 | 39 | |
|---|
| 34 | 40 | if (h->kinfo.dcb_ops->ieee_getpfc) |
|---|
| 35 | 41 | return h->kinfo.dcb_ops->ieee_getpfc(h, pfc); |
|---|
| .. | .. |
|---|
| 37 | 43 | return -EOPNOTSUPP; |
|---|
| 38 | 44 | } |
|---|
| 39 | 45 | |
|---|
| 40 | | -static |
|---|
| 41 | | -int hns3_dcbnl_ieee_setpfc(struct net_device *ndev, struct ieee_pfc *pfc) |
|---|
| 46 | +static int hns3_dcbnl_ieee_setpfc(struct net_device *ndev, struct ieee_pfc *pfc) |
|---|
| 42 | 47 | { |
|---|
| 43 | 48 | struct hnae3_handle *h = hns3_get_handle(ndev); |
|---|
| 44 | 49 | |
|---|
| 50 | + if (hns3_nic_resetting(ndev)) |
|---|
| 51 | + return -EBUSY; |
|---|
| 52 | + |
|---|
| 45 | 53 | if (h->kinfo.dcb_ops->ieee_setpfc) |
|---|
| 46 | 54 | return h->kinfo.dcb_ops->ieee_setpfc(h, pfc); |
|---|
| 47 | 55 | |
|---|