forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
....@@ -52,7 +52,7 @@
5252
5353 #define BNX2X_PCI_ALLOC(y, size) \
5454 ({ \
55
- void *x = dma_zalloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
55
+ void *x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
5656 if (x) \
5757 DP(NETIF_MSG_HW, \
5858 "BNX2X_PCI_ALLOC: Physical %Lx Virtual %p\n", \
....@@ -496,11 +496,11 @@
496496 int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac);
497497 int bnx2x_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos,
498498 __be16 vlan_proto);
499
+int bnx2x_set_vf_spoofchk(struct net_device *dev, int idx, bool val);
499500
500501 /* select_queue callback */
501502 u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb,
502
- struct net_device *sb_dev,
503
- select_queue_fallback_t fallback);
503
+ struct net_device *sb_dev);
504504
505505 static inline void bnx2x_update_rx_prod(struct bnx2x *bp,
506506 struct bnx2x_fastpath *fp,
....@@ -528,8 +528,6 @@
528528 REG_WR_RELAXED(bp, fp->ustorm_rx_prods_offset + i * 4,
529529 ((u32 *)&rx_prods)[i]);
530530
531
- mmiowb(); /* keep prod updates ordered */
532
-
533531 DP(NETIF_MSG_RX_STATUS,
534532 "queue[%d]: wrote bd_prod %u cqe_prod %u sge_prod %u\n",
535533 fp->index, bd_prod, rx_comp_prod, rx_sge_prod);
....@@ -543,9 +541,7 @@
543541 /* NAPI poll Tx part */
544542 int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata);
545543
546
-/* suspend/resume callbacks */
547
-int bnx2x_suspend(struct pci_dev *pdev, pm_message_t state);
548
-int bnx2x_resume(struct pci_dev *pdev);
544
+extern const struct dev_pm_ops bnx2x_pm_ops;
549545
550546 /* Release IRQ vectors */
551547 void bnx2x_free_irq(struct bnx2x *bp);
....@@ -619,7 +615,7 @@
619615 *
620616 * @dev: net device
621617 */
622
-void bnx2x_tx_timeout(struct net_device *dev);
618
+void bnx2x_tx_timeout(struct net_device *dev, unsigned int txqueue);
623619
624620 /** bnx2x_get_c2s_mapping - read inner-to-outer vlan configuration
625621 * c2s_map should have BNX2X_MAX_PRIORITY entries.
....@@ -654,7 +650,6 @@
654650 REG_WR(bp, igu_addr, cmd_data.sb_id_and_flags);
655651
656652 /* Make sure that ACK is written */
657
- mmiowb();
658653 barrier();
659654 }
660655
....@@ -675,7 +670,6 @@
675670 REG_WR(bp, hc_addr, (*(u32 *)&igu_ack));
676671
677672 /* Make sure that ACK is written */
678
- mmiowb();
679673 barrier();
680674 }
681675
....@@ -831,9 +825,9 @@
831825 int i;
832826
833827 for_each_rx_queue_cnic(bp, i) {
834
- napi_hash_del(&bnx2x_fp(bp, i, napi));
835
- netif_napi_del(&bnx2x_fp(bp, i, napi));
828
+ __netif_napi_del(&bnx2x_fp(bp, i, napi));
836829 }
830
+ synchronize_net();
837831 }
838832
839833 static inline void bnx2x_del_all_napi(struct bnx2x *bp)
....@@ -841,9 +835,9 @@
841835 int i;
842836
843837 for_each_eth_queue(bp, i) {
844
- napi_hash_del(&bnx2x_fp(bp, i, napi));
845
- netif_napi_del(&bnx2x_fp(bp, i, napi));
838
+ __netif_napi_del(&bnx2x_fp(bp, i, napi));
846839 }
840
+ synchronize_net();
847841 }
848842
849843 int bnx2x_set_int_mode(struct bnx2x *bp);
....@@ -966,12 +960,12 @@
966960 start_params->network_cos_mode = STATIC_COS;
967961 else /* CHIP_IS_E1X */
968962 start_params->network_cos_mode = FW_WRR;
969
- if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].count) {
970
- port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN].dst_port;
963
+ if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN]) {
964
+ port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_VXLAN];
971965 start_params->vxlan_dst_port = port;
972966 }
973
- if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].count) {
974
- port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE].dst_port;
967
+ if (bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE]) {
968
+ port = bp->udp_tunnel_ports[BNX2X_UDP_PORT_GENEVE];
975969 start_params->geneve_dst_port = port;
976970 }
977971