-/*************************************************************************
- * qla1280_proc_info
- *
- * Description:
- * Return information to handle /proc support for the driver.
- *
- * buffer - ptrs to a page buffer
- *
- * Returns:
- *************************************************************************/
-#define PROC_BUF &qla1280_buffer[len]
-
-static int qla1280_proc_info(struct Scsi_Host *host, char *buffer,
- char **start, off_t offset, int length, int inout)
-{
- struct scsi_qla_host *ha = (struct scsi_qla_host *)host->hostdata;
- struct qla_boards *bdp = &ql1280_board_tbl[ha->devnum];
- int size = 0;
- int len = 0;
-
- if (inout)
- return -ENOSYS;
-
- /*
- * if our old buffer is the right size use it otherwise
- * allocate a new one.
- */
- if (qla1280_buffer_size != PAGE_SIZE) {
- /* deallocate this buffer and get a new one */
- if (qla1280_buffer != NULL) {
- free_page((unsigned long)qla1280_buffer);
- qla1280_buffer_size = 0;
- }
- qla1280_buffer = (char *)get_zeroed_page(GFP_KERNEL);
- }
- if (qla1280_buffer == NULL) {
- size = sprintf(buffer, "qla1280 - kmalloc error at line %d\n",
- __LINE__);
- return size;
- }
- /* save the size of our buffer */
- qla1280_buffer_size = PAGE_SIZE;
-
- /* 3.20 clear the buffer we use for proc display */
- memset(qla1280_buffer, 0, PAGE_SIZE);
-
- /* start building the print buffer */
- size = sprintf(PROC_BUF,
- "QLogic PCI to SCSI Adapter for ISP 1280/12160:\n"
- " Firmware version: %2d.%02d.%02d, Driver version %s\n",
- bdp->fwver[0], bdp->fwver[1], bdp->fwver[2],
- QLA1280_VERSION);
-
- len += size;
-
- size = sprintf(PROC_BUF, "SCSI Host Adapter Information: %s\n",
- bdp->name);
- len += size;
- size = sprintf(PROC_BUF, "Request Queue count= 0x%x, Response "
- "Queue count= 0x%x\n",
- REQUEST_ENTRY_CNT, RESPONSE_ENTRY_CNT);
- len += size;
- size = sprintf(PROC_BUF, "Number of pending commands = 0x%lx\n",
- ha->actthreads);
- len += size;
- size = sprintf(PROC_BUF, "Number of free request entries = %d\n",
- ha->req_q_cnt);
- len += size;
- size = sprintf(PROC_BUF, "\n"); /* 1 */
- len += size;
-
- if (len >= qla1280_buffer_size) {
- printk(KERN_WARNING
- "qla1280: Overflow buffer in qla1280_proc.c\n");
- }
-
- if (offset > len - 1) {
- free_page((unsigned long) qla1280_buffer);
- qla1280_buffer = NULL;
- qla1280_buffer_size = length = 0;
- *start = NULL;
- } else {
- *start = &qla1280_buffer[offset]; /* Start of wanted data */
- if (len - offset < length) {
- length = len - offset;
- }
- }
- return length;
-}
-
-