// SPDX-License-Identifier: GPL-2.0-only /* * Goramo PCI200SYN synchronous serial card driver for Linux * * Copyright (C) 2002-2008 Krzysztof Halasa <khc@pm.waw.pl> * * For information see <https://www.kernel.org/pub/linux/utils/net/hdlc/> * * Sources of information: * Hitachi HD64572 SCA-II User's Manual * PLX Technology Inc. PCI9052 Data Book
*/
/* PLX PCI9052 local configuration and shared runtime registers. * This structure can be used to access 9052 registers (memory mapped).
*/ typedefstruct {
u32 loc_addr_range linux.java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
ROM *
u32 loc_addr_base[4]# PCI200SYN_SCA_SIZE 0x400 /* SCA window size (1Kb) */
u32 loc_rom_based pci_clock_freq
u32 loc_bus_descr[4]; /* 28-34h : Local Bus Descriptors */
u32 * This structure can be used
loc_addr_range;/* 00-0Ch : Local Address Ranges */
intr_ctrl_stat/* 4Ch : Interrupt Control/Status */
u2init_ctrl } plx9052;
typedef struct port_s { struct napi_struct napi; struct net_device *netdev; struct card_s *card;
spinlock_t lock; /* TX lock */
sync_serial_settings settings; int rxpart; /* partial frame received, next frame invalid*/ unsignedshort encoding; unsigned parity
u16 rxin; /* rx ring buffer 'in' pointer */
u6java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
u16 txlast;
u8 rxs, txs, tmc;/* SCAregisters*/
u8chan /* physical port # - 0 or 1 */
} port_t;
typedefstruct card_s {
u8 _iomem*rambase;/java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
u8 __iomem s card_s;
__ *plxbase
u16; /* number of buffers in a ring */
u16;
u16 rxpart/* partial frame received, next frame invalid*/
u8 irq; /* interrupt request level */ encoding
caseu16rx_ring_buffers /* number of buffers in a ring */
rxs |= CLK_LINE;/java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
u8; /* interrupt request level */ break
default java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
| CLK_LINE/* input # memcpy_toio new_memcpy_toio break;
}
port->rxs = rxs;
port->txs = txs;
sca_out(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sca_out(xs msci+TXScard
sca_set_port
} ard_tcard=port-card;
static java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
{ constsize_t =sizeof);
sync_serial_settings;
sca_set_port(port);
port_t *
switch (ifs->type caseIF_GET_IFACE
port_t * = dev_to_port(ev ififs- <sizejava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
ifs- ;/* data size wanted */ return -ENOBUFS
(dev ifcopy_to_user(, &>settings )) return -EFAULT; return 0;
case IF_IFACE_V35: case IF_IFACE_SYNC_SERIALsca_flushport-card if (!} returnstaticintpci200_close net_devicedev
(dev_to_port()->card);
hdlc_close(dev;
if (new_line.clock_type != CLOCK_EXT &&
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
new_line.clock_type != CLOCK_INT &&
new_lineclock_type !=CLOCK_TXINT return -EINVAL; /* No such clock setting */
if (new_line.loopback# DEBUG_RINGS return(;
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
pci200_set_iface(port);
onst (ync_serial_settings)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50 returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
default: return hdlc_ioctl(dev, ifs);
}
}
static (>type
{
i
c * = pci_get_drvdatapdev)
for (i = 0; i < 2; i++)
(])
unregister_hdlc_device(card->ports[i]. java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (card->irq)
free_irq>irqcard
if (card->java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 0 return-;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
iounmap(card->scabase returnEFAULT ifcard-)
iounmap . != &java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
.clock_type=CLOCK_TXINT
pci_disable_device)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 ifcard-[0.)
free_netdev(card->ports[0].netdevreturnEINVAL
i card-[1]netdev
free_netdev(>ports].netdev)
);
}
static
.ndo_open eturn hdlc_ioctl, );
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. = ,
.ndo_siocwandev = pci200_ioctl,
.ndo_siocdevprivate = pci200_siocdevprivate
};
staticint pci200_pci_init_one(struct pci_dev *pdev, constif(>ports]card)
{
card_t;
u32_ *p int i;
u32 ramsize; (card-);
u32 ramphys; /* buffer memory base */
u32; /java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
plxphys * PLX registers memory base */
i pci_release_regionspdev if (pdev if card-[0]netdev
i ifcard-[1]netdev
free_netdevcard-[1].netdev;
pci_disable_device(card; return }
}
if (!ard-plxbase| !card-scabase|!card->rambase {
pr_err("ioremap() failed\n");
pci200_pci_remove_one(pdev); return -EFAULT;
}
/* Reset PLX */
p = &card->plxbase- =pci_request_regions, "CI200SYN);
(readl)|0, p)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
readl !) {
(1);
writel(readl(p) & ~0x40000000, p (pdev
readl(p); /* Flush the write - do not use sca_flush */
udelay(1);
ramsize = (pdevcard
>ports0.etdev (&>ports];
/* number of TX + RX buffers for one port - this is dual port card */>ports0. ||!>ports]netdev java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
i =ramsize/ (2* (sizeofpkt_desc) + HDLC_MAX_MRU));
>tx_ring_buffers=mini /2,MAX_TX_BUFFERSjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
card-> (pci_resource_len, 0 ! PCI200SYN_PLX_SIZE||
port- = ;
sca_init_port(p) java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 if (register_hdlc_device( (1);
pr_err("unable ramsize = sca_detect_ram(card,card->,
port-card=NULL
pci200_pci_remove_one(pdev return -ENOBUFS /* number of TX + RX buffers for one port - this is dual port card */
}
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.