• Home
  • Raw
  • Download

Lines Matching refs:handle

16 static struct hns_mac_cb *hns_get_mac_cb(struct hnae_handle *handle)  in hns_get_mac_cb()  argument
18 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_get_mac_cb()
28 static struct hns_ppe_cb *hns_get_ppe_cb(struct hnae_handle *handle) in hns_get_ppe_cb() argument
32 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_get_ppe_cb()
139 static void hns_ae_put_handle(struct hnae_handle *handle) in hns_ae_put_handle() argument
141 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_put_handle()
144 for (i = 0; i < handle->q_num; i++) in hns_ae_put_handle()
145 hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0; in hns_ae_put_handle()
150 static int hns_ae_wait_flow_down(struct hnae_handle *handle) in hns_ae_wait_flow_down() argument
158 for (i = 0; i < handle->q_num; i++) { in hns_ae_wait_flow_down()
159 ret = hns_rcb_wait_tx_ring_clean(handle->qs[i]); in hns_ae_wait_flow_down()
164 ppe_cb = hns_get_ppe_cb(handle); in hns_ae_wait_flow_down()
169 dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_wait_flow_down()
172 ret = hns_dsaf_wait_pkt_clean(dsaf_dev, handle->dport_id); in hns_ae_wait_flow_down()
176 vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_wait_flow_down()
185 static void hns_ae_ring_enable_all(struct hnae_handle *handle, int val) in hns_ae_ring_enable_all() argument
187 int q_num = handle->q_num; in hns_ae_ring_enable_all()
191 hns_rcb_ring_enable_hw(handle->qs[i], val); in hns_ae_ring_enable_all()
204 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(q->handle); in hns_ae_fini_queue()
210 static int hns_ae_set_mac_address(struct hnae_handle *handle, const void *p) in hns_ae_set_mac_address() argument
213 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_mac_address()
216 dev_err(handle->owner_dev, "is not valid ether addr !\n"); in hns_ae_set_mac_address()
220 ret = hns_mac_change_vf_addr(mac_cb, handle->vf_id, p); in hns_ae_set_mac_address()
222 dev_err(handle->owner_dev, in hns_ae_set_mac_address()
230 static int hns_ae_add_uc_address(struct hnae_handle *handle, in hns_ae_add_uc_address() argument
233 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_add_uc_address()
238 return hns_mac_add_uc_addr(mac_cb, handle->vf_id, addr); in hns_ae_add_uc_address()
241 static int hns_ae_rm_uc_address(struct hnae_handle *handle, in hns_ae_rm_uc_address() argument
244 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_rm_uc_address()
249 return hns_mac_rm_uc_addr(mac_cb, handle->vf_id, addr); in hns_ae_rm_uc_address()
252 static int hns_ae_set_multicast_one(struct hnae_handle *handle, void *addr) in hns_ae_set_multicast_one() argument
256 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_multicast_one()
266 dev_err(handle->owner_dev, in hns_ae_set_multicast_one()
272 ret = hns_mac_get_inner_port_num(mac_cb, handle->vf_id, &port_num); in hns_ae_set_multicast_one()
278 dev_err(handle->owner_dev, in hns_ae_set_multicast_one()
285 static int hns_ae_clr_multicast(struct hnae_handle *handle) in hns_ae_clr_multicast() argument
287 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_clr_multicast()
292 return hns_mac_clr_multicast(mac_cb, handle->vf_id); in hns_ae_clr_multicast()
295 static int hns_ae_set_mtu(struct hnae_handle *handle, int new_mtu) in hns_ae_set_mtu() argument
297 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_mtu()
316 for (i = 0; i < handle->q_num; i++) { in hns_ae_set_mtu()
317 q = handle->qs[i]; in hns_ae_set_mtu()
326 static void hns_ae_set_tso_stats(struct hnae_handle *handle, int enable) in hns_ae_set_tso_stats() argument
328 struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle); in hns_ae_set_tso_stats()
333 static int hns_ae_start(struct hnae_handle *handle) in hns_ae_start() argument
337 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_start()
343 for (k = 0; k < handle->q_num; k++) { in hns_ae_start()
345 hns_rcb_int_clr_hw(handle->qs[k], in hns_ae_start()
348 hns_rcbv2_int_clr_hw(handle->qs[k], in hns_ae_start()
351 hns_ae_ring_enable_all(handle, 1); in hns_ae_start()
359 static void hns_ae_stop(struct hnae_handle *handle) in hns_ae_stop() argument
361 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_stop()
364 hns_rcb_wait_fbd_clean(handle->qs, handle->q_num, RCB_INT_FLAG_TX); in hns_ae_stop()
372 hns_ae_ring_enable_all(handle, 0); in hns_ae_stop()
375 hns_rcb_wait_fbd_clean(handle->qs, handle->q_num, RCB_INT_FLAG_RX); in hns_ae_stop()
380 static void hns_ae_reset(struct hnae_handle *handle) in hns_ae_reset() argument
382 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_reset()
414 static int hns_ae_get_link_status(struct hnae_handle *handle) in hns_ae_get_link_status() argument
417 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_link_status()
424 static int hns_ae_get_mac_info(struct hnae_handle *handle, in hns_ae_get_mac_info() argument
427 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_mac_info()
432 static bool hns_ae_need_adjust_link(struct hnae_handle *handle, int speed, in hns_ae_need_adjust_link() argument
435 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_need_adjust_link()
440 static void hns_ae_adjust_link(struct hnae_handle *handle, int speed, in hns_ae_adjust_link() argument
443 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_adjust_link()
453 if (hns_ae_wait_flow_down(handle)) { in hns_ae_adjust_link()
473 static void hns_ae_get_pauseparam(struct hnae_handle *handle, in hns_ae_get_pauseparam() argument
476 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_get_pauseparam()
484 if (handle->port_type == HNAE_PORT_SERVICE) in hns_ae_get_pauseparam()
488 static void hns_ae_set_promisc_mode(struct hnae_handle *handle, u32 en) in hns_ae_set_promisc_mode() argument
490 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_promisc_mode()
492 hns_dsaf_set_promisc_mode(hns_ae_get_dsaf_dev(handle->dev), en); in hns_ae_set_promisc_mode()
496 static int hns_ae_set_pauseparam(struct hnae_handle *handle, in hns_ae_set_pauseparam() argument
499 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_set_pauseparam()
508 if (handle->port_type == HNAE_PORT_SERVICE) { in hns_ae_set_pauseparam()
518 static void hns_ae_get_coalesce_usecs(struct hnae_handle *handle, in hns_ae_get_coalesce_usecs() argument
522 container_of(handle->qs[0], struct ring_pair_cb, q); in hns_ae_get_coalesce_usecs()
530 static void hns_ae_get_max_coalesced_frames(struct hnae_handle *handle, in hns_ae_get_max_coalesced_frames() argument
534 container_of(handle->qs[0], struct ring_pair_cb, q); in hns_ae_get_max_coalesced_frames()
535 struct dsaf_device *dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_get_max_coalesced_frames()
538 handle->port_type == HNAE_PORT_DEBUG) in hns_ae_get_max_coalesced_frames()
548 static int hns_ae_set_coalesce_usecs(struct hnae_handle *handle, in hns_ae_set_coalesce_usecs() argument
552 container_of(handle->qs[0], struct ring_pair_cb, q); in hns_ae_set_coalesce_usecs()
558 static int hns_ae_set_coalesce_frames(struct hnae_handle *handle, in hns_ae_set_coalesce_frames() argument
563 container_of(handle->qs[0], struct ring_pair_cb, q); in hns_ae_set_coalesce_frames()
564 struct dsaf_device *dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_set_coalesce_frames()
567 handle->port_type == HNAE_PORT_DEBUG) { in hns_ae_set_coalesce_frames()
588 static void hns_ae_get_coalesce_range(struct hnae_handle *handle, in hns_ae_get_coalesce_range() argument
596 assert(handle); in hns_ae_get_coalesce_range()
598 dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_get_coalesce_range()
604 handle->port_type == HNAE_PORT_DEBUG) in hns_ae_get_coalesce_range()
619 static void hns_ae_update_stats(struct hnae_handle *handle, in hns_ae_update_stats() argument
628 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_update_stats()
633 dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_update_stats()
637 ppe_cb = hns_get_ppe_cb(handle); in hns_ae_update_stats()
638 mac_cb = hns_get_mac_cb(handle); in hns_ae_update_stats()
640 for (idx = 0; idx < handle->q_num; idx++) { in hns_ae_update_stats()
641 queue = handle->qs[idx]; in hns_ae_update_stats()
702 static void hns_ae_get_stats(struct hnae_handle *handle, u64 *data) in hns_ae_get_stats() argument
710 if (!handle || !data) { in hns_ae_get_stats()
715 vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_get_stats()
716 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_stats()
717 ppe_cb = hns_get_ppe_cb(handle); in hns_ae_get_stats()
719 for (idx = 0; idx < handle->q_num; idx++) { in hns_ae_get_stats()
720 hns_rcb_get_stats(handle->qs[idx], p); in hns_ae_get_stats()
734 static void hns_ae_get_strings(struct hnae_handle *handle, in hns_ae_get_strings() argument
741 struct dsaf_device *dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_get_strings()
745 assert(handle); in hns_ae_get_strings()
747 vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_get_strings()
749 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_strings()
750 ppe_cb = hns_get_ppe_cb(handle); in hns_ae_get_strings()
752 for (idx = 0; idx < handle->q_num; idx++) { in hns_ae_get_strings()
767 static int hns_ae_get_sset_count(struct hnae_handle *handle, int stringset) in hns_ae_get_sset_count() argument
771 struct dsaf_device *dsaf_dev = hns_ae_get_dsaf_dev(handle->dev); in hns_ae_get_sset_count()
773 assert(handle); in hns_ae_get_sset_count()
775 mac_cb = hns_get_mac_cb(handle); in hns_ae_get_sset_count()
777 sset_count += hns_rcb_get_ring_sset_count(stringset) * handle->q_num; in hns_ae_get_sset_count()
787 static int hns_ae_config_loopback(struct hnae_handle *handle, in hns_ae_config_loopback() argument
791 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_config_loopback()
792 struct hns_mac_cb *mac_cb = hns_get_mac_cb(handle); in hns_ae_config_loopback()
813 static void hns_ae_update_led_status(struct hnae_handle *handle) in hns_ae_update_led_status() argument
817 assert(handle); in hns_ae_update_led_status()
818 mac_cb = hns_get_mac_cb(handle); in hns_ae_update_led_status()
825 static int hns_ae_cpld_set_led_id(struct hnae_handle *handle, in hns_ae_cpld_set_led_id() argument
830 assert(handle); in hns_ae_cpld_set_led_id()
832 mac_cb = hns_get_mac_cb(handle); in hns_ae_cpld_set_led_id()
837 static void hns_ae_get_regs(struct hnae_handle *handle, void *data) in hns_ae_get_regs() argument
841 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_get_regs()
842 struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle); in hns_ae_get_regs()
850 for (i = 0; i < handle->q_num; i++) { in hns_ae_get_regs()
851 hns_rcb_get_ring_regs(handle->qs[i], p); in hns_ae_get_regs()
862 static int hns_ae_get_regs_len(struct hnae_handle *handle) in hns_ae_get_regs_len() argument
865 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle); in hns_ae_get_regs_len()
869 total_num += hns_rcb_get_ring_regs_count() * handle->q_num; in hns_ae_get_regs_len()
878 static u32 hns_ae_get_rss_key_size(struct hnae_handle *handle) in hns_ae_get_rss_key_size() argument
883 static u32 hns_ae_get_rss_indir_size(struct hnae_handle *handle) in hns_ae_get_rss_indir_size() argument
888 static int hns_ae_get_rss(struct hnae_handle *handle, u32 *indir, u8 *key, in hns_ae_get_rss() argument
891 struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle); in hns_ae_get_rss()
909 static int hns_ae_set_rss(struct hnae_handle *handle, const u32 *indir, in hns_ae_set_rss() argument
912 struct hns_ppe_cb *ppe_cb = hns_get_ppe_cb(handle); in hns_ae_set_rss()