/* if there are BE_NUM_VLANS_SUPPORTED or lesser number of VLANS configured, program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, set the BE in promiscuous VLAN mode.  */
static int be_vid_config(struct be_adapter *adapter)
/* if there are BE_NUM_VLANS_SUPPORTED or lesser number of VLANS configured, program them in BE. If more than BE_NUM_VLANS_SUPPORTED are configured, set the BE in promiscuous VLAN mode.  */
static int be_vid_config(struct be_adapter *adapter)
{
	u16 vtag[BE_NUM_VLANS_SUPPORTED];
	u16 ntags = 0, i;
	int status;
	if (adapter->num_vlans <= BE_NUM_VLANS_SUPPORTED)  {
		for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
			if (adapter->vlan_tag[i]) {
				vtag[ntags] = cpu_to_le16(i);
				ntags++;
			}
		}
		status = be_cmd_vlan_config(adapter, adapter->if_handle,
					vtag, ntags, 1, 0);
	} else {
		status = be_cmd_vlan_config(adapter, adapter->if_handle,
					NULL, 0, 1, 1);
	}
	return status;
}