drivers/scsi/fnic/fdls_disc.c

Source file repositories/reference/linux-study-clean/drivers/scsi/fnic/fdls_disc.c

File Facts

System
Linux kernel
Corpus path
drivers/scsi/fnic/fdls_disc.c
Extension
.c
Size
162300 bytes
Lines
5094
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!reclaim_entry) {
			schedule_delayed_work(&oxid_pool->schedule_oxid_free_retry,
				msecs_to_jiffies(SCHEDULE_OXID_FREE_RETRY_TIME));
			return;
		}

		clear_bit(idx, oxid_pool->pending_schedule_free);
		reclaim_entry->oxid_idx = idx;
		reclaim_entry->expires = round_jiffies(jiffies + delay_j);
		spin_lock_irqsave(&fnic->fnic_lock, flags);
		list_add_tail(&reclaim_entry->links, &oxid_pool->oxid_reclaim_list);
		spin_unlock_irqrestore(&fnic->fnic_lock, flags);
		schedule_delayed_work(&oxid_pool->oxid_reclaim_work, delay_j);
	}
}

static bool fdls_is_oxid_fabric_req(uint16_t oxid)
{
	int oxid_frame_type = FNIC_FRAME_TYPE(oxid);

	switch (oxid_frame_type) {
	case FNIC_FRAME_TYPE_FABRIC_FLOGI:
	case FNIC_FRAME_TYPE_FABRIC_PLOGI:
	case FNIC_FRAME_TYPE_FABRIC_RPN:
	case FNIC_FRAME_TYPE_FABRIC_RFT:
	case FNIC_FRAME_TYPE_FABRIC_RFF:
	case FNIC_FRAME_TYPE_FABRIC_GPN_FT:
	case FNIC_FRAME_TYPE_FABRIC_LOGO:
		break;
	default:
		return false;
	}
	return true;
}

static bool fdls_is_oxid_fdmi_req(uint16_t oxid)
{
	int oxid_frame_type = FNIC_FRAME_TYPE(oxid);

	switch (oxid_frame_type) {
	case FNIC_FRAME_TYPE_FDMI_PLOGI:
	case FNIC_FRAME_TYPE_FDMI_RHBA:
	case FNIC_FRAME_TYPE_FDMI_RPA:
		break;
	default:
		return false;
	}
	return true;
}

static bool fdls_is_oxid_tgt_req(uint16_t oxid)
{
	int oxid_frame_type = FNIC_FRAME_TYPE(oxid);

	switch (oxid_frame_type) {
	case FNIC_FRAME_TYPE_TGT_PLOGI:
	case FNIC_FRAME_TYPE_TGT_PRLI:
	case FNIC_FRAME_TYPE_TGT_ADISC:
	case FNIC_FRAME_TYPE_TGT_LOGO:
		break;
	default:
		return false;
	}
	return true;
}

static void fdls_reset_oxid_pool(struct fnic_iport_s *iport)
{
	struct fnic_oxid_pool_s *oxid_pool = &iport->oxid_pool;

	oxid_pool->next_idx = 0;
}

void fnic_del_fabric_timer_sync(struct fnic *fnic)
{
	fnic->iport.fabric.del_timer_inprogress = 1;
	spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
	timer_delete_sync(&fnic->iport.fabric.retry_timer);
	spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
	fnic->iport.fabric.del_timer_inprogress = 0;
}

void fnic_del_tport_timer_sync(struct fnic *fnic,
						struct fnic_tport_s *tport)
{
	tport->del_timer_inprogress = 1;
	spin_unlock_irqrestore(&fnic->fnic_lock, fnic->lock_flags);
	timer_delete_sync(&tport->retry_timer);
	spin_lock_irqsave(&fnic->fnic_lock, fnic->lock_flags);
	tport->del_timer_inprogress = 0;

Annotation

Implementation Notes