1148
1149 mc_cnt = 0;
1150 QEDE_LIST_FOR_EACH_ENTRY(ptr_entry, &qede->mclist.head,
1151 qede_mcast_list_entry_t, mclist_entry) {
1152 COPY_ETH_ADDRESS(ptr_entry->mac, tmpmc);
1153 tmpmc += ETH_ALLEN;
1154 mc_cnt++;
1155 }
1156 qede->mc_cnt = mc_cnt;
1157 if (mc_cnt <=64) {
1158 ret = qede_set_rx_mac_mcast(qede, ECORE_FILTER_ADD,
1159 (unsigned char *)mc_macs, mc_cnt);
1160 if ((qede->params.multi_promisc_fl == B_TRUE) &&
1161 (qede->params.promisc_fl == B_FALSE)) {
1162 mode = QEDE_FILTER_RX_MODE_REGULAR;
1163 ret = qede_set_filter_rx_mode(qede, mode);
1164 }
1165 qede->params.multi_promisc_fl = B_FALSE;
1166 } else {
1167 if ((qede->params.multi_promisc_fl == B_FALSE) &&
1168 (qede->params.promisc_fl = B_FALSE)) {
1169 ret = qede_set_filter_rx_mode(qede,
1170 QEDE_FILTER_RX_MODE_MULTI_PROMISC);
1171 }
1172 qede->params.multi_promisc_fl = B_TRUE;
1173 qede_info(qede, "mode is MULTI_PROMISC");
1174 }
1175 exit:
1176 kmem_free(mc_macs, size);
1177 qede_info(qede, "multicast ret %d mc_cnt %d\n", ret, qede->mc_cnt);
1178 return (ret);
1179 }
1180
1181 /*
1182 * This function is used to enable or disable multicast packet reception for
1183 * particular multicast addresses.
1184 * (flag) TRUE = add, FALSE = remove
1185 */
1186 static int
1187 qede_mac_multicast(void *arg,
1188 boolean_t flag,
|
1148
1149 mc_cnt = 0;
1150 QEDE_LIST_FOR_EACH_ENTRY(ptr_entry, &qede->mclist.head,
1151 qede_mcast_list_entry_t, mclist_entry) {
1152 COPY_ETH_ADDRESS(ptr_entry->mac, tmpmc);
1153 tmpmc += ETH_ALLEN;
1154 mc_cnt++;
1155 }
1156 qede->mc_cnt = mc_cnt;
1157 if (mc_cnt <=64) {
1158 ret = qede_set_rx_mac_mcast(qede, ECORE_FILTER_ADD,
1159 (unsigned char *)mc_macs, mc_cnt);
1160 if ((qede->params.multi_promisc_fl == B_TRUE) &&
1161 (qede->params.promisc_fl == B_FALSE)) {
1162 mode = QEDE_FILTER_RX_MODE_REGULAR;
1163 ret = qede_set_filter_rx_mode(qede, mode);
1164 }
1165 qede->params.multi_promisc_fl = B_FALSE;
1166 } else {
1167 if ((qede->params.multi_promisc_fl == B_FALSE) &&
1168 (qede->params.promisc_fl == B_FALSE)) {
1169 ret = qede_set_filter_rx_mode(qede,
1170 QEDE_FILTER_RX_MODE_MULTI_PROMISC);
1171 }
1172 qede->params.multi_promisc_fl = B_TRUE;
1173 qede_info(qede, "mode is MULTI_PROMISC");
1174 }
1175 exit:
1176 kmem_free(mc_macs, size);
1177 qede_info(qede, "multicast ret %d mc_cnt %d\n", ret, qede->mc_cnt);
1178 return (ret);
1179 }
1180
1181 /*
1182 * This function is used to enable or disable multicast packet reception for
1183 * particular multicast addresses.
1184 * (flag) TRUE = add, FALSE = remove
1185 */
1186 static int
1187 qede_mac_multicast(void *arg,
1188 boolean_t flag,
|