Translation

(itstool) path: sect1/para
English
or
2/100
Context English Portuguese (Brazil) State
async_flags - bitmask of installed Async handler, unused now async_flags - bitmask do manipulador Async instalado, n�o usado agora
hpath_id - highest Path ID in the subsystem, unused now hpath_id - maior ID do caminho no subsistema, n�o usado agora
unit_number - the controller unit number, cam_sim_unit(sim) unit_number - o n�mero da unidade controladora, cam_sim_unit (sim)
bus_id - the bus number, cam_sim_bus(sim) bus_id - o n�mero do barramento, cam_sim_bus (sim)
initiator_id - the SCSI ID of the controller itself initiator_id - o ID SCSI do pr�prio controlador
base_transfer_speed - nominal transfer speed in KB/s for asynchronous narrow transfers, equals to 3300 for SCSI base_transfer_speed - velocidade de transfer�ncia nominal em KB / s para transfer�ncias estreitas ass�ncronas, igual a 3300 para SCSI
sim_vid - SIM driver's vendor id, a zero-terminated string of maximal length SIM_IDLEN including the terminating zero sim_vid - ID do fornecedor do driver SIM, uma string terminada em zero de comprimento m�ximo SIM_IDLEN incluindo o zero de finaliza��o
hba_vid - SCSI controller's vendor id, a zero-terminated string of maximal length HBA_IDLEN including the terminating zero hba_vid - ID do fornecedor do controlador SCSI, uma cadeia terminada em zero de comprimento m�ximo HBA_IDLEN incluindo o zero de finaliza��o
dev_name - device driver name, a zero-terminated string of maximal length DEV_IDLEN including the terminating zero, equal to cam_sim_name(sim) dev_name - nome do driver de dispositivo, uma cadeia terminada em zero de comprimento m�ximo DEV_IDLEN incluindo o zero final, igual a cam_sim_name (sim)
The recommended way of setting the string fields is using strncpy, like: A maneira recomendada de configurar os campos de string � usando strncpy, como:
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
After setting the values set the status to CAM_REQ_CMP and mark the CCB as done. Depois de definir os valores, defina o status como CAM_REQ_CMP e marque o CCB como conclu�do.
Polling Polling
The poll function is used to simulate the interrupts when the interrupt subsystem is not functioning (for example, when the system has crashed and is creating the system dump). The CAM subsystem sets the proper interrupt level before calling the poll routine. So all it needs to do is to call the interrupt routine (or the other way around, the poll routine may be doing the real action and the interrupt routine would just call the poll routine). Why bother about a separate function then? Due to different calling conventions. The <function>xxx_poll</function> routine gets the struct cam_sim pointer as its argument when the PCI interrupt routine by common convention gets pointer to the struct <varname remap="structname">xxx_softc</varname> and the ISA interrupt routine gets just the device unit number. So the poll routine would normally look as: A fun��o de pesquisa � usada para simular as interrup��es quando o subsistema de interrup��o n�o est� funcionando (por exemplo, quando o sistema travou e est� criando o dump do sistema). O subsistema CAM define o n�vel de interrup��o adequado antes de chamar a rotina de pesquisa. ele precisa fazer � chamar a rotina de interrup��o (ou vice-versa, a rotina de poll pode estar fazendo a a��o real e a rotina de interrup��o apenas chamaria a rotina de poll) Por que se preocupar com uma fun��o separada ent�o? conven��es. <function> xxx_poll </function> rotina obt�m o ponteiro struct cam_sim como seu argumento quando a rotina de interrup��o PCI por conven��o comum obt�m ponteiro para a estrutura <varname remap="structname"> xxx_softc </varname> e a rotina de interrup��o ISA obt�m apenas o n�mero da unidade do dispositivo. Ent�o a rotina de pesquisa normalmente seria como:
static void
xxx_poll(struct cam_sim *sim)
{
xxx_intr((struct xxx_softc *)cam_sim_softc(sim)); /* for PCI device */
}
static void
xxx_poll(struct cam_sim *sim)
{
xxx_intr((struct xxx_softc *)cam_sim_softc(sim)); /* for PCI device */
}
or ou
static void
xxx_poll(struct cam_sim *sim)
{
xxx_intr(cam_sim_unit(sim)); /* for ISA device */
}
static void
xxx_poll(struct cam_sim *sim)
{
xxx_intr(cam_sim_unit(sim)); /* for ISA device */
}
Asynchronous Events Eventos ass�ncronos
If an asynchronous event callback has been set up then the callback function should be defined. Se um retorno de chamada de evento ass�ncrono tiver sido configurado, a fun��o de retorno de chamada dever� ser definida.
static void
ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
static void
ahc_async(void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
callback_arg - the value supplied when registering the callback callback_arg - o valor fornecido ao registrar o retorno de chamada
code - identifies the type of event c�digo - identifica o tipo de evento
path - identifies the devices to which the event applies caminho - identifica os dispositivos aos quais o evento se aplica
arg - event-specific argument arg - argumento espec�fico do evento
Implementation for a single type of event, AC_LOST_DEVICE, looks like: Implementa��o para um �nico tipo de evento, AC_LOST_DEVICE, se parece com:
struct xxx_softc *softc;
struct cam_sim *sim;
int targ;
struct ccb_trans_settings neg;

sim = (struct cam_sim *)callback_arg;
softc = (struct xxx_softc *)cam_sim_softc(sim);
switch (code) {
case AC_LOST_DEVICE:
targ = xpt_path_target_id(path);
if(targ &lt;= OUR_MAX_SUPPORTED_TARGET) {
clean_negotiations(softc, targ);
/* send indication to CAM */
neg.bus_width = 8;
neg.sync_period = neg.sync_offset = 0;
neg.valid = (CCB_TRANS_BUS_WIDTH_VALID
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
xpt_async(AC_TRANSFER_NEG, path, &amp;neg);
}
break;
default:
break;
}
struct xxx_softc *softc;
struct cam_sim *sim;
int targ;
struct ccb_trans_settings neg;

sim = (struct cam_sim *)callback_arg;
softc = (struct xxx_softc *)cam_sim_softc(sim);
switch (code) {
case AC_LOST_DEVICE:
targ = xpt_path_target_id(path);
if(targ &lt;= OUR_MAX_SUPPORTED_TARGET) {
clean_negotiations(softc, targ);
/* send indication to CAM */
neg.bus_width = 8;
neg.sync_period = neg.sync_offset = 0;
neg.valid = (CCB_TRANS_BUS_WIDTH_VALID
| CCB_TRANS_SYNC_RATE_VALID | CCB_TRANS_SYNC_OFFSET_VALID);
xpt_async(AC_TRANSFER_NEG, path, &amp;neg);
}
break;
default:
break;
}
<primary>SCSI</primary><secondary>interrupts</secondary> <primary> SCSI </primary><secondary> interrompe </secondary>
The exact type of the interrupt routine depends on the type of the peripheral bus (PCI, ISA and so on) to which the SCSI controller is connected. O tipo exato da rotina de interrup��o depende do tipo de barramento do perif�rico (PCI, ISA e assim por diante) ao qual o controlador SCSI est� conectado.
The interrupt routines of the SIM drivers run at the interrupt level splcam. So <function>splcam()</function> should be used in the driver to synchronize activity between the interrupt routine and the rest of the driver (for a multiprocessor-aware driver things get yet more interesting but we ignore this case here). The pseudo-code in this document happily ignores the problems of synchronization. The real code must not ignore them. A simple-minded approach is to set <function>splcam()</function> on the entry to the other routines and reset it on return thus protecting them by one big critical section. To make sure that the interrupt level will be always restored a wrapper function can be defined, like: As rotinas de interrup��o dos drivers SIM s�o executadas no splcam do n�vel de interrup��o. <function> splcam () </function> deve ser usado no driver para sincronizar a atividade entre a rotina de interrup��o e o restante do driver (para um driver com reconhecimento de multiprocessador, as coisas ficam ainda mais interessantes, mas ignoramos este caso aqui). O pseudo-c�digo neste documento ignora felizmente os problemas de sincroniza��o. O c�digo real n�o deve ignor�-los. Uma abordagem simplista � definir <function> splcam () </function> na entrada para as outras rotinas e redefini-lo no retorno, protegendo-as por uma grande se��o cr�tica. Para ter certeza de que o n�vel de interrup��o ser� sempre restaurado, uma fun��o wrapper pode ser definida, como:
static void
xxx_action(struct cam_sim *sim, union ccb *ccb)
{
int s;
s = splcam();
xxx_action1(sim, ccb);
splx(s);
}

static void
xxx_action1(struct cam_sim *sim, union ccb *ccb)
{
... process the request ...
}
static void
xxx_action(struct cam_sim *sim, union ccb *ccb)
{
int s;
s = splcam();
xxx_action1(sim, ccb);
splx(s);
}

static void
xxx_action1(struct cam_sim *sim, union ccb *ccb)
{
... process the request ...
}
This approach is simple and robust but the problem with it is that interrupts may get blocked for a relatively long time and this would negatively affect the system's performance. On the other hand the functions of the <function>spl()</function> family have rather high overhead, so vast amount of tiny critical sections may not be good either. Esta abordagem � simples e robusta, mas o problema � que as interrup��es podem ficar bloqueadas por um tempo relativamente longo e isso afetaria negativamente o desempenho do sistema. Por outro lado, as fun��es do <function> spl () </function> a fam�lia tem uma sobrecarga bastante alta, uma quantidade t�o grande de se��es cr�ticas min�sculas pode n�o ser boa tamb�m "
Component Translation Difference to current string
This translation Needs editing FreeBSD Doc/books_arch-handbook
The following strings have the same context and source.
Translated FreeBSD Doc/articles_contributing
Translated FreeBSD Doc/articles_new-users
Translated FreeBSD Doc/books_porters-handbook
Needs editing FreeBSD Doc/books_developers-handbook
Translated FreeBSD Doc/books_fdp-primer
Translated FreeBSD Doc/books_handbook

Loading…

User avatar None

New source string

FreeBSD Doc / books_arch-handbookPortuguese (Brazil)

New source string a year ago
Browse all component changes

Glossary

English Portuguese (Brazil)
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/para
Source string location
book.translate.xml:21111
String age
a year ago
Source string age
a year ago
Translation file
books/pt_BR/arch-handbook.po, string 2338