-int dc390_set_info (char *buffer, int length, PACB pACB)
-{
- char *pos = buffer, *p0 = buffer;
- char needs_inquiry = 0;
- int dum = 0;
- char dev;
- PDCB pDCB = pACB->pLinkDCB;
- DC390_IFLAGS;
- DC390_AFLAGS;
- pos[length] = 0;
-
- DC390_LOCK_IO(pACB->pScsiHost);
- DC390_LOCK_ACB;
- /* UPPERCASE */
- /* Don't use kernel toupper, because of 2.0.x bug: ctmp unexported */
- while (*pos)
- { if (*pos >='a' && *pos <= 'z') *pos = *pos + 'A' - 'a'; pos++; }
-
- /* Remove WS */
- pos = strsep (&buffer, " \t:\n=,;");
- if (!*pos) goto ok;
-
- next:
- if (!memcmp (pos, "RESET", 5)) goto reset;
- else if (!memcmp (pos, "INQUIRY", 7)) goto inquiry;
- else if (!memcmp (pos, "REMOVE", 6)) goto remove;
- else if (!memcmp (pos, "ADD", 3)) goto add;
- else if (!memcmp (pos, "START", 5)) goto start;
- else if (!memcmp (pos, "DUMP", 4)) goto dump;
-
- if (isdigit (*pos))
- {
- /* Device config line */
- int dev, id, lun; char* pdec;
- char olddevmode;
-
- SCANF (buffer, pos, p0, dev, 0, pACB->DCBCnt-1);
- if (*pos) { SCANF (buffer, pos, p0, id, 0, 7); } else goto einv;
- if (*pos) { SCANF (buffer, pos, p0, lun, 0, 7); } else goto einv;
- if (!*pos) goto einv;
-
- PARSEDEBUG(printk (KERN_INFO "DC390: config line %i %i %i:\"%s\"\n", dev, id, lun, prstr (pos, &buffer[length])));
- pDCB = pACB->pLinkDCB;
- for (dum = 0; dum < dev; dum++) pDCB = pDCB->pNextDCB;
- /* Sanity Check */
- if (pDCB->TargetID != id || pDCB->TargetLUN != lun)
- {
- printk (KERN_ERR "DC390: no such device: Idx=%02i ID=%02i LUN=%02i\n",
- dev, id, lun);
- goto einv2;
- }
-
- if (pDCB->pWaitingSRB || pDCB->pGoingSRB)
- {
- printk ("DC390: Cannot change dev (%i-%i) cfg: Pending requests\n",
- pDCB->TargetID, pDCB->TargetLUN);
- goto einv;
- }
-
- olddevmode = pDCB->DevMode;
- YESNO (buffer, pos, pDCB->DevMode, PARITY_CHK_);
- needs_inquiry++;
- YESNO (buffer, pos, pDCB->DevMode, SYNC_NEGO_);
- if ((olddevmode & SYNC_NEGO_) == (pDCB->DevMode & SYNC_NEGO_)) needs_inquiry--;
- needs_inquiry++;
- YESNO (buffer, pos, pDCB->DevMode, EN_DISCONNECT_);
- if ((olddevmode & EN_DISCONNECT_) == (pDCB->DevMode & EN_DISCONNECT_)) needs_inquiry--;
- YESNO (buffer, pos, pDCB->DevMode, SEND_START_);
- needs_inquiry++;
- YESNO (buffer, pos, pDCB->DevMode, TAG_QUEUEING_);
- if ((olddevmode & TAG_QUEUEING_) == (pDCB->DevMode & TAG_QUEUEING_)) needs_inquiry--;
-
- dc390_updateDCB (pACB, pDCB);
- if (!*pos) goto ok;
-
- olddevmode = pDCB->NegoPeriod;
- /* Look for decimal point (Speed) */
- pdec = pos;
- while (pdec++ < &buffer[length]) if (*pdec == '.') break;
- /* NegoPeriod */
- if (*pos != '-')
- {
- SCANF (buffer, pos, p0, dum, 72, 800);
- pDCB->NegoPeriod = dum >> 2;
- if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;
- if (!pos) goto ok;
- if (memcmp (pos, "NS", 2) == 0) pos = strsep (&pos, " \t\n:=,;.");
- }
- else pos = strsep (&pos, " \t\n:=,;.");
- if (!*pos) goto ok;
-
- /* Sync Speed in MHz */
- if (*pos != '-')
- {
- SCANF (buffer, pos, p0, dum, 1, 13);
- pDCB->NegoPeriod = (1000/dum) >> 2;
- if (pDCB->NegoPeriod != olddevmode && !pos) needs_inquiry++;
- if (!*pos) goto ok;
- /* decimal */
- if (pos-1 == pdec)
- {
- int dumold = dum;
- dum = simple_strtoul (pos, &p0, 10) * 10;
- for (; p0-pos > 1; p0--) dum /= 10;
- pDCB->NegoPeriod = (100000/(100*dumold + dum)) >> 2;
- if (pDCB->NegoPeriod < 19) pDCB->NegoPeriod = 19;
- pos = strsep (&pos, " \t\n:=,;");
- if (!*pos) goto ok;
- }
- if (*pos == 'M') pos = strsep (&pos, " \t\n:=,;");
- if (pDCB->NegoPeriod != olddevmode) needs_inquiry++;