-/**
- * This method will program the unsolicited frames (UFs) into the UF address
- * table and construct the UF frame structure being modeled in the core. It
- * will handle the case where some of the UFs are not being used and thus
- * should have entries programmed to zero in the address table.
- * @uf_control: This parameter specifies the unsolicted frame control object
- * for which to construct the unsolicited frames objects.
- * @uf_buffer_phys_address: This parameter specifies the physical address for
- * the first unsolicited frame buffer.
- * @uf_buffer_virt_address: This parameter specifies the virtual address for
- * the first unsolicited frame buffer.
- * @unused_uf_header_entries: This parameter specifies the number of unused UF
- * headers. This value can be non-zero when there are a non-power of 2
- * number of unsolicited frames being supported.
- * @used_uf_header_entries: This parameter specifies the number of actually
- * utilized UF headers.
- *
- */
-static void scic_sds_unsolicited_frame_control_construct_frames(
- struct scic_sds_unsolicited_frame_control *uf_control,
- dma_addr_t uf_buffer_phys_address,
- void *uf_buffer_virt_address,
- u32 unused_uf_header_entries,
- u32 used_uf_header_entries)
-{
- u32 index;
- struct scic_sds_unsolicited_frame *uf;
-
- /*
- * Program the unused buffers into the UF address table and the
- * controller's array of UFs.
- */
- for (index = 0; index < unused_uf_header_entries; index++) {
- uf = &uf_control->buffers.array[index];
-
- uf->buffer = NULL;
- uf_control->address_table.array[index] = 0;
- uf->header = &uf_control->headers.array[index];
- uf->state = UNSOLICITED_FRAME_EMPTY;
- }
-
- /*
- * Program the actual used UF buffers into the UF address table and
- * the controller's array of UFs.
- */
- for (index = unused_uf_header_entries;
- index < unused_uf_header_entries + used_uf_header_entries;
- index++) {
- uf = &uf_control->buffers.array[index];
-
- uf_control->address_table.array[index] = uf_buffer_phys_address;
-
- uf->buffer = uf_buffer_virt_address;
- uf->header = &uf_control->headers.array[index];
- uf->state = UNSOLICITED_FRAME_EMPTY;
-
- /*
- * Increment the address of the physical and virtual memory
- * pointers. Everything is aligned on 1k boundary with an
- * increment of 1k.
- */
- uf_buffer_virt_address += SCU_UNSOLICITED_FRAME_BUFFER_SIZE;
- uf_buffer_phys_address += SCU_UNSOLICITED_FRAME_BUFFER_SIZE;
- }
-}
-