forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
....@@ -37,10 +37,12 @@
3737 /**
3838 * bnx2x_exe_queue_init - init the Exe Queue object
3939 *
40
+ * @bp: driver handle
4041 * @o: pointer to the object
4142 * @exe_len: length
4243 * @owner: pointer to the owner
4344 * @validate: validate function pointer
45
+ * @remove: remove function pointer
4446 * @optimize: optimize function pointer
4547 * @exec: execute function pointer
4648 * @get: get function pointer
....@@ -103,7 +105,7 @@
103105 *
104106 * @bp: driver handle
105107 * @o: queue
106
- * @cmd: new command to add
108
+ * @elem: new command to add
107109 * @restore: true - do not optimize the command
108110 *
109111 * If the element is optimized or is illegal, frees it.
....@@ -277,7 +279,7 @@
277279 *
278280 * @bp: device handle
279281 * @state: state which is to be cleared
280
- * @state_p: state buffer
282
+ * @pstate: state buffer
281283 *
282284 */
283285 static inline int bnx2x_state_wait(struct bnx2x *bp, int state,
....@@ -424,8 +426,8 @@
424426 * @bp: device handle
425427 * @o: vlan_mac object
426428 *
427
- * @details: Non-blocking implementation; should be called under execution
428
- * queue lock.
429
+ * Context: Non-blocking implementation; should be called under execution
430
+ * queue lock.
429431 */
430432 static int __bnx2x_vlan_mac_h_write_trylock(struct bnx2x *bp,
431433 struct bnx2x_vlan_mac_obj *o)
....@@ -445,7 +447,7 @@
445447 * @bp: device handle
446448 * @o: vlan_mac object
447449 *
448
- * @details Should be called under execution queue lock; notice it might release
450
+ * details Should be called under execution queue lock; notice it might release
449451 * and reclaim it during its run.
450452 */
451453 static void __bnx2x_vlan_mac_h_exec_pending(struct bnx2x *bp,
....@@ -475,7 +477,7 @@
475477 * @o: vlan_mac object
476478 * @ramrod_flags: ramrod flags of missed execution
477479 *
478
- * @details Should be called under execution queue lock.
480
+ * Context: Should be called under execution queue lock.
479481 */
480482 static void __bnx2x_vlan_mac_h_pend(struct bnx2x *bp,
481483 struct bnx2x_vlan_mac_obj *o,
....@@ -493,7 +495,7 @@
493495 * @bp: device handle
494496 * @o: vlan_mac object
495497 *
496
- * @details Should be called under execution queue lock. Notice if a pending
498
+ * Context: Should be called under execution queue lock. Notice if a pending
497499 * execution exists, it would perform it - possibly releasing and
498500 * reclaiming the execution queue lock.
499501 */
....@@ -516,7 +518,7 @@
516518 * @bp: device handle
517519 * @o: vlan_mac object
518520 *
519
- * @details Should be called under the execution queue lock. May sleep. May
521
+ * Context: Should be called under the execution queue lock. May sleep. May
520522 * release and reclaim execution queue lock during its run.
521523 */
522524 static int __bnx2x_vlan_mac_h_read_lock(struct bnx2x *bp,
....@@ -536,7 +538,7 @@
536538 * @bp: device handle
537539 * @o: vlan_mac object
538540 *
539
- * @details May sleep. Claims and releases execution queue lock during its run.
541
+ * Context: May sleep. Claims and releases execution queue lock during its run.
540542 */
541543 int bnx2x_vlan_mac_h_read_lock(struct bnx2x *bp,
542544 struct bnx2x_vlan_mac_obj *o)
....@@ -556,7 +558,7 @@
556558 * @bp: device handle
557559 * @o: vlan_mac object
558560 *
559
- * @details Should be called under execution queue lock. Notice if a pending
561
+ * Context: Should be called under execution queue lock. Notice if a pending
560562 * execution exists, it would be performed if this was the last
561563 * reader. possibly releasing and reclaiming the execution queue lock.
562564 */
....@@ -591,7 +593,7 @@
591593 * @bp: device handle
592594 * @o: vlan_mac object
593595 *
594
- * @details Notice if a pending execution exists, it would be performed if this
596
+ * Context: Notice if a pending execution exists, it would be performed if this
595597 * was the last reader. Claims and releases the execution queue lock
596598 * during its run.
597599 */
....@@ -968,7 +970,7 @@
968970 *
969971 * @bp: device handle
970972 * @o: queue
971
- * @type:
973
+ * @type: the type of echo
972974 * @cam_offset: offset in cam memory
973975 * @hdr: pointer to a header to setup
974976 *
....@@ -1608,8 +1610,8 @@
16081610 *
16091611 * @bp: device handle
16101612 * @o: bnx2x_vlan_mac_obj
1611
- * @cqe:
1612
- * @cont: if true schedule next execution chunk
1613
+ * @cqe: completion element
1614
+ * @ramrod_flags: if set schedule next execution chunk
16131615 *
16141616 */
16151617 static int bnx2x_complete_vlan_mac(struct bnx2x *bp,
....@@ -1656,7 +1658,7 @@
16561658 * bnx2x_optimize_vlan_mac - optimize ADD and DEL commands.
16571659 *
16581660 * @bp: device handle
1659
- * @o: bnx2x_qable_obj
1661
+ * @qo: bnx2x_qable_obj
16601662 * @elem: bnx2x_exeq_elem
16611663 */
16621664 static int bnx2x_optimize_vlan_mac(struct bnx2x *bp,
....@@ -1714,10 +1716,10 @@
17141716 * bnx2x_vlan_mac_get_registry_elem - prepare a registry element
17151717 *
17161718 * @bp: device handle
1717
- * @o:
1718
- * @elem:
1719
- * @restore:
1720
- * @re:
1719
+ * @o: vlan object
1720
+ * @elem: element
1721
+ * @restore: to restore or not
1722
+ * @re: registry
17211723 *
17221724 * prepare a registry element according to the current command request.
17231725 */
....@@ -1768,9 +1770,9 @@
17681770 * bnx2x_execute_vlan_mac - execute vlan mac command
17691771 *
17701772 * @bp: device handle
1771
- * @qo:
1772
- * @exe_chunk:
1773
- * @ramrod_flags:
1773
+ * @qo: bnx2x_qable_obj pointer
1774
+ * @exe_chunk: chunk
1775
+ * @ramrod_flags: flags
17741776 *
17751777 * go and send a ramrod!
17761778 */
....@@ -2006,8 +2008,8 @@
20062008 * bnx2x_vlan_mac_del_all - delete elements with given vlan_mac_flags spec
20072009 *
20082010 * @bp: device handle
2009
- * @o:
2010
- * @vlan_mac_flags:
2011
+ * @o: vlan object info
2012
+ * @vlan_mac_flags: vlan flags
20112013 * @ramrod_flags: execution flags to be used for this deletion
20122014 *
20132015 * if the last operation has completed successfully and there are no
....@@ -2767,7 +2769,7 @@
27672769 /**
27682770 * bnx2x_mcast_get_next_bin - get the next set bin (index)
27692771 *
2770
- * @o:
2772
+ * @o: multicast object info
27712773 * @last: index to start looking from (including)
27722774 *
27732775 * returns the next found (set) bin or a negative value if none is found.
....@@ -2892,7 +2894,7 @@
28922894 * bnx2x_mcast_handle_restore_cmd_e2 - restore configuration from the registry
28932895 *
28942896 * @bp: device handle
2895
- * @o:
2897
+ * @o: multicast object info
28962898 * @start_bin: index in the registry to start from (including)
28972899 * @rdata_idx: index in the ramrod data to start from
28982900 *
....@@ -2977,8 +2979,8 @@
29772979
29782980 cmd_pos->data.macs_num--;
29792981
2980
- DP(BNX2X_MSG_SP, "Deleting MAC. %d left,cnt is %d\n",
2981
- cmd_pos->data.macs_num, cnt);
2982
+ DP(BNX2X_MSG_SP, "Deleting MAC. %d left,cnt is %d\n",
2983
+ cmd_pos->data.macs_num, cnt);
29822984
29832985 /* Break if we reached the maximum
29842986 * number of rules.
....@@ -3202,11 +3204,11 @@
32023204 }
32033205
32043206 /**
3205
- * bnx2x_mcast_handle_current_cmd -
3207
+ * bnx2x_mcast_handle_current_cmd - send command if room
32063208 *
32073209 * @bp: device handle
3208
- * @p:
3209
- * @cmd:
3210
+ * @p: ramrod mcast info
3211
+ * @cmd: command
32103212 * @start_cnt: first line in the ramrod data that may be used
32113213 *
32123214 * This function is called iff there is enough place for the current command in
....@@ -3258,7 +3260,7 @@
32583260 /* DEL command deletes all currently configured MACs */
32593261 case BNX2X_MCAST_CMD_DEL:
32603262 o->set_registry_size(o, 0);
3261
- /* fall through */
3263
+ fallthrough;
32623264
32633265 /* RESTORE command will restore the entire multicast configuration */
32643266 case BNX2X_MCAST_CMD_RESTORE:
....@@ -3323,7 +3325,7 @@
33233325 * bnx2x_mcast_set_rdata_hdr_e2 - sets a header values
33243326 *
33253327 * @bp: device handle
3326
- * @p:
3328
+ * @p: ramrod parameters
33273329 * @len: number of rules to handle
33283330 */
33293331 static inline void bnx2x_mcast_set_rdata_hdr_e2(struct bnx2x *bp,
....@@ -3592,13 +3594,13 @@
35923594 /* DEL command deletes all currently configured MACs */
35933595 case BNX2X_MCAST_CMD_DEL:
35943596 o->set_registry_size(o, 0);
3595
- /* fall through */
3597
+ fallthrough;
35963598
35973599 /* RESTORE command will restore the entire multicast configuration */
35983600 case BNX2X_MCAST_CMD_RESTORE:
35993601 p->mcast_list_len = reg_sz;
3600
- DP(BNX2X_MSG_SP, "Command %d, p->mcast_list_len=%d\n",
3601
- cmd, p->mcast_list_len);
3602
+ DP(BNX2X_MSG_SP, "Command %d, p->mcast_list_len=%d\n",
3603
+ cmd, p->mcast_list_len);
36023604 break;
36033605
36043606 case BNX2X_MCAST_CMD_ADD:
....@@ -3684,7 +3686,7 @@
36843686 * bnx2x_mcast_set_rdata_hdr_e1 - set header values in mac_configuration_cmd
36853687 *
36863688 * @bp: device handle
3687
- * @p:
3689
+ * @p: ramrod parameters
36883690 * @len: number of rules to handle
36893691 */
36903692 static inline void bnx2x_mcast_set_rdata_hdr_e1(struct bnx2x *bp,
....@@ -3711,7 +3713,7 @@
37113713 * bnx2x_mcast_handle_restore_cmd_e1 - restore command for 57710
37123714 *
37133715 * @bp: device handle
3714
- * @o:
3716
+ * @o: multicast info
37153717 * @start_idx: index in the registry to start from
37163718 * @rdata_idx: index in the ramrod data to start from
37173719 *
....@@ -3735,8 +3737,8 @@
37353737
37363738 i++;
37373739
3738
- DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n",
3739
- cfg_data.mac);
3740
+ DP(BNX2X_MSG_SP, "About to configure %pM mcast MAC\n",
3741
+ cfg_data.mac);
37403742 }
37413743
37423744 *rdata_idx = i;
....@@ -3798,10 +3800,10 @@
37983800 /**
37993801 * bnx2x_get_fw_mac_addr - revert the bnx2x_set_fw_mac_addr().
38003802 *
3801
- * @fw_hi:
3802
- * @fw_mid:
3803
- * @fw_lo:
3804
- * @mac:
3803
+ * @fw_hi: address
3804
+ * @fw_mid: address
3805
+ * @fw_lo: address
3806
+ * @mac: mac address
38053807 */
38063808 static inline void bnx2x_get_fw_mac_addr(__le16 *fw_hi, __le16 *fw_mid,
38073809 __le16 *fw_lo, u8 *mac)
....@@ -3818,7 +3820,7 @@
38183820 * bnx2x_mcast_refresh_registry_e1 -
38193821 *
38203822 * @bp: device handle
3821
- * @cnt:
3823
+ * @o: multicast info
38223824 *
38233825 * Check the ramrod data first entry flag to see if it's a DELETE or ADD command
38243826 * and update the registry correspondingly: if ADD - allocate a memory and add
....@@ -4311,7 +4313,7 @@
43114313 /**
43124314 * bnx2x_init_credit_pool - initialize credit pool internals.
43134315 *
4314
- * @p:
4316
+ * @p: credit pool
43154317 * @base: Base entry in the CAM to use.
43164318 * @credit: pool size.
43174319 *
....@@ -4725,8 +4727,8 @@
47254727 * bnx2x_queue_comp_cmd - complete the state change command.
47264728 *
47274729 * @bp: device handle
4728
- * @o:
4729
- * @cmd:
4730
+ * @o: queue info
4731
+ * @cmd: command to exec
47304732 *
47314733 * Checks that the arrived completion is expected.
47324734 */
....@@ -5039,7 +5041,6 @@
50395041 /* As no ramrod is sent, complete the command immediately */
50405042 o->complete_cmd(bp, o, BNX2X_Q_CMD_INIT);
50415043
5042
- mmiowb();
50435044 smp_mb();
50445045
50455046 return 0;
....@@ -5478,8 +5479,8 @@
54785479 * bnx2x_queue_chk_transition - check state machine of a regular Queue
54795480 *
54805481 * @bp: device handle
5481
- * @o:
5482
- * @params:
5482
+ * @o: queue info
5483
+ * @params: queue state
54835484 *
54845485 * (not Forwarding)
54855486 * It both checks if the requested command is legal in a current
....@@ -5736,8 +5737,8 @@
57365737 * bnx2x_func_state_change_comp - complete the state machine transition
57375738 *
57385739 * @bp: device handle
5739
- * @o:
5740
- * @cmd:
5740
+ * @o: function info
5741
+ * @cmd: more info
57415742 *
57425743 * Called on state change transition. Completes the state
57435744 * machine transition only - no HW interaction.
....@@ -5777,8 +5778,8 @@
57775778 * bnx2x_func_comp_cmd - complete the state change command
57785779 *
57795780 * @bp: device handle
5780
- * @o:
5781
- * @cmd:
5781
+ * @o: function info
5782
+ * @cmd: more info
57825783 *
57835784 * Checks that the arrived completion is expected.
57845785 */
....@@ -5797,8 +5798,8 @@
57975798 * bnx2x_func_chk_transition - perform function state machine transition
57985799 *
57995800 * @bp: device handle
5800
- * @o:
5801
- * @params:
5801
+ * @o: function info
5802
+ * @params: state parameters
58025803 *
58035804 * It both checks if the requested command is legal in a current
58045805 * state and, if it's legal, sets a `next_state' in the object