/* Maximum number of 8-byte words can be sent in a NIC control message.
*/ #define MAX_NCTRL_UDD 32
typedefvoid (*octnic_ctrl_pkt_cb_fn_t) (void *);
/* Structure of control information passed by the NIC module to the OSI *layerwhensendingcontrolcommandstoOcteondevicesoftware.
*/ struct octnic_ctrl_pkt { /** Command to be passed to the Octeon device software. */ union octnet_cmd ncmd;
/** Send buffer */ void *data;
u64 dmadata;
/** Response buffer */ void *rdata;
u64 dmardata;
/** Additional data that may be needed by some commands. */
u64 udd[MAX_NCTRL_UDD];
/** Input queue to use to send this command. */
u64 iq_no;
/** The network device that issued the control command. */
u64 netpndev;
/** Callback function called when the command has been fetched */
octnic_ctrl_pkt_cb_fn_t cb_fn;
/** Structure of data information passed by the NIC module to the OSI *layerwhenforwardingdatatoOcteondevicesoftware.
*/ struct octnic_data_pkt { /** Pointer to information maintained by NIC module for this packet. The *OSIlayerpassesthisas-istothedriver.
*/ void *buf;
/** Type of buffer passed in "buf" above. */
u32 reqtype;
/** Total data bytes to be transferred in this command. */
u32 datasize;
/** Command to be passed to the Octeon device software. */ union octeon_instr_64B cmd;
/** Input queue to use to send this command. */
u32 q_no;
};
/** Structure passed by NIC module to OSI layer to prepare a command to send *networkdatatoOcteon.
*/ union octnic_cmd_setup { struct {
u32 iq_no:8;
u32 gather:1;
u32 timestamp:1;
u32 ip_csum:1;
u32 transport_csum:1;
u32 tnl_csum:1;
u32 rsvd:19;
/* assume that rflag is cleared so therefore front data will only have *irhandossp[1]andossp[2]foratotalof24bytes
*/
ih3->pkind = oct->instr_queue[setup->s.iq_no]->txpciq.s.pkind; /*PKI IH*/
ih3->fsz = LIO_PCICMD_O3;
/** Utility function to prepare a 64B NIC instruction based on a setup command *@paramcmd-pointertoinstructiontobefilledin. *@paramsetup-pointertothesetupstructure *@paramq_no-whichqueueforbackpressure * *Assumesthecmdinstructionispre-allocated,butnofieldsarefilledin.
*/ staticinlinevoid
octnet_prepare_pci_cmd(struct octeon_device *oct, union octeon_instr_64B *cmd, union octnic_cmd_setup *setup, u32 tag)
{ if (OCTEON_CN6XXX(oct))
octnet_prepare_pci_cmd_o2(oct, cmd, setup, tag); else
octnet_prepare_pci_cmd_o3(oct, cmd, setup, tag);
}
/** Allocate and a soft command with space for a response immediately following *thecommnad. *@paramoct-octeondevicepointer *@paramcmd-pointertothecommandstructure,pre-filledforeverything *excepttheresponse. *@paramrdatasize-sizeinbytesoftheresponse. * *@returnspointertoallocatedbufferwithcommandcopiedintoit,and *responsespaceimmediatelyfollowing.
*/ void *
octeon_alloc_soft_command_resp(struct octeon_device *oct, union octeon_instr_64B *cmd,
u32 rdatasize);
/** Send a NIC data packet to the device *@paramoct-octeondevicepointer *@paramndata-controlstructurewithqueueing,andbufferinformation * *@returnsIQ_FAILEDifitfailedtoaddtotheinputqueue.IQ_STOPifthe *queueshouldbestopped,andIQ_SEND_OKifitsentokay.
*/ int octnet_send_nic_data_pkt(struct octeon_device *oct, struct octnic_data_pkt *ndata, int xmit_more);
/** Send a NIC control packet to the device *@paramoct-octeondevicepointer *@paramnctrl-controlstructurewithcommand,timout,andcallbackinfo *@returnsIQ_FAILEDifitfailedtoaddtotheinputqueue.IQ_STOPifthe *queueshouldbestopped,andIQ_SEND_OKifitsentokay.
*/ int
octnet_send_nic_ctrl_pkt(struct octeon_device *oct, struct octnic_ctrl_pkt *nctrl);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.