/* cxgb3i_hba_find_by_netdev - find the cxgb3i_hba structure via net_device @t3dev: t3cdev adapter  */
static struct cxgb3i_hba* cxgb3i_hba_find_by_netdev(struct net_device *ndev)
/* cxgb3i_hba_find_by_netdev - find the cxgb3i_hba structure via net_device @t3dev: t3cdev adapter  */
static struct cxgb3i_hba* cxgb3i_hba_find_by_netdev(struct net_device *ndev)
{
	struct cxgb3i_adapter *snic;
	int i;
	if (ndev->priv_flags & IFF_802_1Q_VLAN)
		ndev = vlan_dev_real_dev(ndev);
	read_lock(&cxgb3i_snic_rwlock);
	list_for_each_entry(snic, &cxgb3i_snic_list, list_head) {
		for (i = 0; i < snic->hba_cnt; i++) {
			if (snic->hba[i]->ndev == ndev) {
				read_unlock(&cxgb3i_snic_rwlock);
				return snic->hba[i];
			}
		}
	}
	read_unlock(&cxgb3i_snic_rwlock);
	return NULL;
}