NAME

     atmio - ATM device control operations


SYNOPSIS

     #include <fore_atm/fore_atm_user.h>


DESCRIPTION

     The ATM device responds to a number  of  ioctl(2)  requests,
     defined in <fore_atm/fore_atm_user.h>. The ioctl(2) requests
     and commands are STREAMS-based on SunOS and IRIX  platforms;
     see  streamio(4)  for details on the STREAMS ioctl(2) inter-
     face.

     This interface is not intended  for  general  use.   Use  of
     these  operations  may  interfere with normal use of the ATM
     network.  This interface  is  likely  to  change  in  future
     releases of the ATM device driver.


IOCTLS FOR THE ATM LAYER

     The following ioctl  commands  are  applicable  to  the  ATM
     layer.

     ATMIOC_GET_MY_ADDRESS
          Returns the ATM-layer address of this ATM device.   The
          result  is  returned  in  an  Atm_address structure, as
          defined in <fore_atm/fore_atm_user.h>.

     ATMIOC_FLUSH_ARP
          Flushes the internal ATM ARP table for the device.

     ATMIOC_DELETE_ARP
          Deletes the ARP table entry for the  hostname  provided
          as  an  argument in the form of the struct arpreq found
          in <net/if_arp.h>. ATMIOC_DELETE_ARP will fail  if  the
          given  hostname does not exist, or if an address family
          other than AF_INET is specified.

     ATMIOC_GET_ARP
          Retrieves the ARP information for the  hostname  speci-
          fied in the argument of the form struct arpreq found in
          <net/if_arp.h>. ATMIOC_GET_ARP will fail if  the  given
          hostname  does not exist, or if an address family other
          than AF_INET is specified.

     ATMIOC_SOFT_RESET
          Resets the connection information for the  ATM  device.
          This  can  be  used to reset the connection information
          for devices connected to an ATM network if fiber  pairs
          on  the  switch are physically moved from one port to a
          separate port.

     ATMIOC_SET_BATCH_SIZE
          Sets the number of cells to be received for a null  AAL
          connection  before the data will be returned in the ATM
          library call atm_recv(4N).  This allows a the driver to
          queue up cells to pass up to the user, thereby reducing
          the  overhead  incurred  for  each  atm_recv(4N)  call.
          Please   see   atm_recv(4N)   and  atm_connect(4N)  for
          details.

     ATMIOC_GET_BATCH_SIZE
          Returns the current batch size setting.


IOCTLS FOR ATM STATISTICS

     The following ioctl commands are applicable to the ATM layer
     and AAL layers.

     ATMIOC_ATM_LAYER_STATS
          Returns  driver  statistics  for  the  ATM  layer.  The
          statistics  are  returned in the Atm_layer_stats struc-
          ture defined in <fore_atm/fore_atm_user.h>.

     ATMIOC_AAL0_STATS
          Returns  driver  statistics  for  the  null  adaptation
          layer.  The  statistics  are returned in the Aal0_stats
          structure defined in <fore_atm/fore_atm_user.h>.

     ATMIOC_AAL4_STATS
          Returns driver statistics for AAL 3/4.  The  statistics
          are  returned  in  the  Aal4_stats structure defined in
          <fore_atm/fore_atm_user.h>.

     ATMIOC_AAL5_STATS
          Returns driver statistics for AAL 5. The statistics are
          returned   in   the  Aal5_stats  structure  defined  in
          <fore_atm/fore_atm_user.h>.

     ATMIOC_ZERO_STATISTICS
          Resets all driver statistics to zero.


IOCTLS FOR LOW-LEVEL HARDWARE ACCESS

     The following operations support low-level access to the ATM
     device.  They are not for general use.

     ATMIOC_INTR_OFF
          Turns off the interrupts in the driver for the ATM dev-
          ice.  Note that while the hardware interrupts may still
          occur, they will be caught  and  then  ignored  by  the
          driver.

     ATMIOC_INTR_ON
          Turns  on  the  interrupts  that  were  turned  off  by
          ATMIOC_INTR_OFF.

     ATMIOC_SET_RAW_CELL
          Delivers the raw cell as specified as an  array  of  15
          words  to  the  hardware.   Note that this raw delivery
          mechanism should be used with extreme caution as  these
          words  are passed to the hardware unchanged and may not
          be in a format that can be interpreted  by  the  driver
          code.   Cells  written  using  this interface should be
          read  using  the  ATMIOC_GET_RAW_CELL  command.   Also,
          interrupts at the driver level should be disabled using
          ATMIOC_INTR_OFF to prevent the driver  from  attempting
          to  read  the  cell.  Note also that 15 words should be
          specified to this interface.  If the interface  is  the
          ASX  switch,  the  first word is interpreted as a route
          word, otherwise, the first word is simply discarded and
          the     remaining     14     words    are    delivered.
          ATMIOC_SET_RAW_CELL will fail if the  number  of  words
          specified is not 15.

     ATMIOC_GET_RAW_CELL
          Reads a raw cell into an array of 15 words.  Note  that
          the  first  word is reserved for the route word for the
          ASX switch; it is undefined for all  other  interfaces.
          Therefore, the actual cell begins at the second word of
          the 15 words.


IOCTLS FOR ASX SWITCH CONTROL SOFTWARE

     The following interfaces are provided to support the  Switch
     Control  Software  for the ASX switch.  These interfaces are
     not for general use.

     ATMIOC_ATTACH_RX_VCI
          Associates the specified VCI with this file descriptor.
          After performing this operation, PDUs arriving over the
          specified VCI are prefixed with the VCI  and  delivered
          via  the file descriptor.  PDUs that are transmitted on
          the file descriptor must also be prefixed with a  local
          VCI  value. This value will be translated by the switch
          hardware to determine the outgoing port(s) and outgoing
          VCI for that PDU.

     ATMIOC_DETACH_RX_VCI
          Deletes the association of the given VCI with this file
          descriptor.

     The following interfaces support the ASX  switch  controller
     ioport.   This  controller ioport behaves as an ATM computer
     interface, generally speaking.

     ATMIOC_CP_ENAB_LOOPBACK
          Enables hardware loopback for  the  controller  ioport.
          Cells  written  to  the  ioport transmit interface will
          immediately return to  the  ioport  receive  interface.
          Routing  of  cells to and from the controller ioport is
          typically done by the  switch  control  software,  thus
          this  interface should not be used when the switch con-
          trol software is running.

     ATMIOC_CP_DIS_LOOPBACK
          Disables the hardware loopback mechanism for  the  con-
          troller  ioport  that  may have been previously enabled
          with the ATMIOC_CP_ENAB_LOOPBACK interface.

     ATMIOC_IOPORT_OFF
          Disables the controller ioport completely.

     ATMIOC_IOPORT_ON
          Enables the controller ioport that may have  been  dis-
          abled using the ATMIOC_IOPORT_OFF interface.


IOCTLS FOR PERMANENT VIRTUAL CONNECTIONS

     The following ioctl commands are applicable to routing of IP
     traffic over PVCs.

     ATMIOC_CREATE_IPPVC
          Establishes an association between  an  IP  destination
          address  and  a PVC.  The IP address and VC identifiers
          are  specified  by  an  Ip_pvc  structure,  defined  in
          <fore_atm/fore_atm_arp.h>.

     ATMIOC_REMOVE_IPPVC
          Removes  the  association  between  an  IP  destination
          address and a PVC.

     ATMIOC_SPANS_OFF
          Disables SPANS protocol messages over  this  ATM  link,
          for use when communicating to a non-SPANS ATM device.

     ATMIOC_SPANS_ON
          Enables SPANS protocol messages over this ATM  link  if
          they have been disabled by ATMIOC_SPANS_OFF.


EXAMPLE FOR SUNOS AND IRIX PLATFORMS

     The following is an example of  the  ioctl(2)  mechanism  on
     STREAMS-based (SunOS and IRIX) platforms.

          #include <sys/ioctl.h>
          #include <sys/stream.h>
          #include <sys/stropts.h>
          #include <fore_atm/fore_atm_user.h>

          struct strioctl ioc;
          Atm_address addr;

          ioc.ic_cmd = ATMIOC_GET_MY_ADDRESS;
          ioc.ic_timout = 0;
          ioc.ic_len = sizeof(addr);
          ioc.ic_dp = (caddr_t) &addr;
          if (ioctl(atm_fd, I_STR, (caddr_t) &ioc) != 0)
               perror("ioctl: ATMIOC_GET_MY_ADDRESS);


EXAMPLE FOR ULTRIX PLATFORMS

     The following is an example of  the  ioctl(2)  mechanism  on
     ULTRIX platforms.

          #include <sys/ioctl.h>
          #include <fore_atm/fore_atm_user.h>

          Atm_address addr;

          if (ioctl(atm_fd, ATMIOC_GET_MY_ADDRESS, (caddr_t) &addr) != 0)
               perror("ioctl: ATMIOC_GET_MY_ADDRESS);


SEE ALSO

     atm_intro(4N), streamio(4)