Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bcollins/linux139…
Browse files Browse the repository at this point in the history
…4-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/bcollins/linux1394-2.6: (28 commits)
  eth1394: replace __constant_htons by htons
  ieee1394: adjust code formatting in highlevel.c
  ieee1394: hl_irqs_lock is taken in hardware interrupt context
  ieee1394_core: switch to kthread API
  ieee1394: sbp2: Kconfig fix
  ieee1394: add preprocessor constant for invalid csr address
  sbp2: fix deregistration of status fifo address space
  [PATCH] eth1394: endian fixes
  Fix broken suspend/resume in ohci1394
  sbp2: use __attribute__((packed)) for on-the-wire structures
  sbp2: provide helptext for CONFIG_IEEE1394_SBP2_PHYS_DMA and mark it experimental
  Update feature removal of obsolete raw1394 ISO requests.
  sbp2: fix S800 transfers if phys_dma is off
  sbp2: remove ohci1394 specific constant
  ohci1394: make phys_dma parameter read-only
  ohci1394: set address range properties
  ieee1394: extend lowlevel API for address range properties
  sbp2: log number of supported concurrent logins
  sbp2: remove manipulation of inquiry response
  ieee1394: save RAM by using a single tlabel for broadcast transactions
  ...
  • Loading branch information
Linus Torvalds committed Jun 21, 2006
2 parents 2eec0e0 + 7136b80 commit 34641a5
Show file tree
Hide file tree
Showing 19 changed files with 462 additions and 456 deletions.
4 changes: 2 additions & 2 deletions Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ Who: Paul E. McKenney <[email protected]>
---------------------------

What: raw1394: requests of type RAW1394_REQ_ISO_SEND, RAW1394_REQ_ISO_LISTEN
When: November 2005
When: November 2006
Why: Deprecated in favour of the new ioctl-based rawiso interface, which is
more efficient. You should really be using libraw1394 for raw1394
access anyway.
Who: Jody McIntyre <scjody@steamballoon.com>
Who: Jody McIntyre <scjody@modernduck.com>

---------------------------

Expand Down
13 changes: 11 additions & 2 deletions drivers/ieee1394/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,17 @@ config IEEE1394_SBP2
1394 bus. SBP-2 devices include harddrives and DVD devices.

config IEEE1394_SBP2_PHYS_DMA
bool "Enable Phys DMA support for SBP2 (Debug)"
depends on IEEE1394 && IEEE1394_SBP2
bool "Enable replacement for physical DMA in SBP2"
depends on IEEE1394 && IEEE1394_SBP2 && EXPERIMENTAL && (X86_32 || PPC_32)
help
This builds sbp2 for use with non-OHCI host adapters which do not
support physical DMA or for when ohci1394 is run with phys_dma=0.
Physical DMA is data movement without assistence of the drivers'
interrupt handlers. This option includes the interrupt handlers
that are required in absence of this hardware feature.
This option is buggy and currently broken on some architectures.
If unsure, say N.
config IEEE1394_ETH1394
tristate "Ethernet over 1394"
Expand Down
2 changes: 1 addition & 1 deletion drivers/ieee1394/csr1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ static int csr1212_append_new_cache(struct csr1212_csr *csr, size_t romsize)
romsize = (romsize + (csr->max_rom - 1)) & ~(csr->max_rom - 1);

csr_addr = csr->ops->allocate_addr_range(romsize, csr->max_rom, csr->private);
if (csr_addr == ~0ULL) {
if (csr_addr == CSR1212_INVALID_ADDR_SPACE) {
return CSR1212_ENOMEM;
}
if (csr_addr < CSR1212_REGISTER_SPACE_BASE) {
Expand Down
1 change: 1 addition & 0 deletions drivers/ieee1394/csr1212.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@

#define CSR1212_EXTENDED_ROM_SIZE (0x10000 * sizeof(u_int32_t))

#define CSR1212_INVALID_ADDR_SPACE -1

/* Config ROM image structures */
struct csr1212_bus_info_block_img {
Expand Down
18 changes: 9 additions & 9 deletions drivers/ieee1394/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,12 @@ void dma_region_free(struct dma_region *dma)
/* find the scatterlist index and remaining offset corresponding to a
given offset from the beginning of the buffer */
static inline int dma_region_find(struct dma_region *dma, unsigned long offset,
unsigned long *rem)
unsigned int start, unsigned long *rem)
{
int i;
unsigned long off = offset;

for (i = 0; i < dma->n_dma_pages; i++) {
for (i = start; i < dma->n_dma_pages; i++) {
if (off < sg_dma_len(&dma->sglist[i])) {
*rem = off;
break;
Expand All @@ -170,21 +170,21 @@ dma_addr_t dma_region_offset_to_bus(struct dma_region * dma,
unsigned long rem = 0;

struct scatterlist *sg =
&dma->sglist[dma_region_find(dma, offset, &rem)];
&dma->sglist[dma_region_find(dma, offset, 0, &rem)];
return sg_dma_address(sg) + rem;
}

void dma_region_sync_for_cpu(struct dma_region *dma, unsigned long offset,
unsigned long len)
{
int first, last;
unsigned long rem;
unsigned long rem = 0;

if (!len)
len = 1;

first = dma_region_find(dma, offset, &rem);
last = dma_region_find(dma, offset + len - 1, &rem);
first = dma_region_find(dma, offset, 0, &rem);
last = dma_region_find(dma, rem + len - 1, first, &rem);

pci_dma_sync_sg_for_cpu(dma->dev, &dma->sglist[first], last - first + 1,
dma->direction);
Expand All @@ -194,13 +194,13 @@ void dma_region_sync_for_device(struct dma_region *dma, unsigned long offset,
unsigned long len)
{
int first, last;
unsigned long rem;
unsigned long rem = 0;

if (!len)
len = 1;

first = dma_region_find(dma, offset, &rem);
last = dma_region_find(dma, offset + len - 1, &rem);
first = dma_region_find(dma, offset, 0, &rem);
last = dma_region_find(dma, rem + len - 1, first, &rem);

pci_dma_sync_sg_for_device(dma->dev, &dma->sglist[first],
last - first + 1, dma->direction);
Expand Down
51 changes: 23 additions & 28 deletions drivers/ieee1394/eth1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ static int eth1394_probe(struct device *dev)
spin_lock_init(&node_info->pdg.lock);
INIT_LIST_HEAD(&node_info->pdg.list);
node_info->pdg.sz = 0;
node_info->fifo = ETHER1394_INVALID_ADDR;
node_info->fifo = CSR1212_INVALID_ADDR_SPACE;

ud->device.driver_data = node_info;
new_node->ud = ud;
Expand Down Expand Up @@ -502,10 +502,8 @@ static void ether1394_reset_priv (struct net_device *dev, int set_mtu)

/* Determine speed limit */
for (i = 0; i < host->node_count; i++)
if (max_speed > host->speed_map[NODEID_TO_NODE(host->node_id) *
64 + i])
max_speed = host->speed_map[NODEID_TO_NODE(host->node_id) *
64 + i];
if (max_speed > host->speed[i])
max_speed = host->speed[i];
priv->bc_sspd = max_speed;

/* We'll use our maxpayload as the default mtu */
Expand Down Expand Up @@ -568,13 +566,11 @@ static void ether1394_add_host (struct hpsb_host *host)
if (!(host->config_roms & HPSB_CONFIG_ROM_ENTRY_IP1394))
return;

fifo_addr = hpsb_allocate_and_register_addrspace(&eth1394_highlevel,
host,
&addr_ops,
ETHER1394_REGION_ADDR_LEN,
ETHER1394_REGION_ADDR_LEN,
-1, -1);
if (fifo_addr == ~0ULL)
fifo_addr = hpsb_allocate_and_register_addrspace(
&eth1394_highlevel, host, &addr_ops,
ETHER1394_REGION_ADDR_LEN, ETHER1394_REGION_ADDR_LEN,
CSR1212_INVALID_ADDR_SPACE, CSR1212_INVALID_ADDR_SPACE);
if (fifo_addr == CSR1212_INVALID_ADDR_SPACE)
goto out;

/* We should really have our own alloc_hpsbdev() function in
Expand Down Expand Up @@ -774,7 +770,7 @@ static int ether1394_rebuild_header(struct sk_buff *skb)
default:
ETH1394_PRINT(KERN_DEBUG, dev->name,
"unable to resolve type %04x addresses.\n",
eth->h_proto);
ntohs(eth->h_proto));
break;
}

Expand All @@ -796,9 +792,8 @@ static int ether1394_header_cache(struct neighbour *neigh, struct hh_cache *hh)
(16 - ETH1394_HLEN));
struct net_device *dev = neigh->dev;

if (type == __constant_htons(ETH_P_802_3)) {
if (type == htons(ETH_P_802_3))
return -1;
}

eth->h_proto = type;
memcpy(eth->h_dest, neigh->ha, dev->addr_len);
Expand Down Expand Up @@ -887,7 +882,7 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
/* If this is an ARP packet, convert it. First, we want to make
* use of some of the fields, since they tell us a little bit
* about the sending machine. */
if (ether_type == __constant_htons (ETH_P_ARP)) {
if (ether_type == htons(ETH_P_ARP)) {
struct eth1394_arp *arp1394 = (struct eth1394_arp*)skb->data;
struct arphdr *arp = (struct arphdr *)skb->data;
unsigned char *arp_ptr = (unsigned char *)(arp + 1);
Expand Down Expand Up @@ -935,16 +930,16 @@ static inline u16 ether1394_parse_encap(struct sk_buff *skb,
*(u32*)arp_ptr = arp1394->sip; /* move sender IP addr */
arp_ptr += arp->ar_pln; /* skip over sender IP addr */

if (arp->ar_op == 1)
if (arp->ar_op == htons(ARPOP_REQUEST))
/* just set ARP req target unique ID to 0 */
*((u64*)arp_ptr) = 0;
else
*((u64*)arp_ptr) = *((u64*)dev->dev_addr);
}

/* Now add the ethernet header. */
if (dev->hard_header (skb, dev, __constant_ntohs (ether_type),
&dest_hw, NULL, skb->len) >= 0)
if (dev->hard_header(skb, dev, ntohs(ether_type), &dest_hw, NULL,
skb->len) >= 0)
ret = ether1394_type_trans(skb, dev);

return ret;
Expand Down Expand Up @@ -1395,7 +1390,7 @@ static inline void ether1394_arp_to_1394arp(struct sk_buff *skb,
/* We need to encapsulate the standard header with our own. We use the
* ethernet header's proto for our own. */
static inline unsigned int ether1394_encapsulate_prep(unsigned int max_payload,
int proto,
__be16 proto,
union eth1394_hdr *hdr,
u16 dg_size, u16 dgl)
{
Expand Down Expand Up @@ -1514,8 +1509,8 @@ static inline void ether1394_prep_gasp_packet(struct hpsb_packet *p,
p->data = ((quadlet_t*)skb->data) - 2;
p->data[0] = cpu_to_be32((priv->host->node_id << 16) |
ETHER1394_GASP_SPECIFIER_ID_HI);
p->data[1] = __constant_cpu_to_be32((ETHER1394_GASP_SPECIFIER_ID_LO << 24) |
ETHER1394_GASP_VERSION);
p->data[1] = cpu_to_be32((ETHER1394_GASP_SPECIFIER_ID_LO << 24) |
ETHER1394_GASP_VERSION);

/* Setting the node id to ALL_NODES (not LOCAL_BUS | ALL_NODES)
* prevents hpsb_send_packet() from setting the speed to an arbitrary
Expand Down Expand Up @@ -1626,7 +1621,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
gfp_t kmflags = in_interrupt() ? GFP_ATOMIC : GFP_KERNEL;
struct eth1394hdr *eth;
struct eth1394_priv *priv = netdev_priv(dev);
int proto;
__be16 proto;
unsigned long flags;
nodeid_t dest_node;
eth1394_tx_type tx_type;
Expand Down Expand Up @@ -1670,9 +1665,9 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
/* Set the transmission type for the packet. ARP packets and IP
* broadcast packets are sent via GASP. */
if (memcmp(eth->h_dest, dev->broadcast, ETH1394_ALEN) == 0 ||
proto == __constant_htons(ETH_P_ARP) ||
(proto == __constant_htons(ETH_P_IP) &&
IN_MULTICAST(__constant_ntohl(skb->nh.iph->daddr)))) {
proto == htons(ETH_P_ARP) ||
(proto == htons(ETH_P_IP) &&
IN_MULTICAST(ntohl(skb->nh.iph->daddr)))) {
tx_type = ETH1394_GASP;
dest_node = LOCAL_BUS | ALL_NODES;
max_payload = priv->bc_maxpayload - ETHER1394_GASP_OVERHEAD;
Expand All @@ -1688,7 +1683,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
goto fail;
}
node_info = (struct eth1394_node_info*)node->ud->device.driver_data;
if (node_info->fifo == ETHER1394_INVALID_ADDR) {
if (node_info->fifo == CSR1212_INVALID_ADDR_SPACE) {
ret = -EAGAIN;
goto fail;
}
Expand All @@ -1704,7 +1699,7 @@ static int ether1394_tx (struct sk_buff *skb, struct net_device *dev)
}

/* If this is an ARP packet, convert it */
if (proto == __constant_htons (ETH_P_ARP))
if (proto == htons(ETH_P_ARP))
ether1394_arp_to_1394arp (skb, dev);

ptask->hdr.words.word1 = 0;
Expand Down
2 changes: 0 additions & 2 deletions drivers/ieee1394/eth1394.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* S3200 (per Table 16-3 of IEEE 1394b-2002). */
#define ETHER1394_REGION_ADDR_LEN 4096

#define ETHER1394_INVALID_ADDR ~0ULL

/* GASP identifier numbers for IPv4 over IEEE 1394 */
#define ETHER1394_GASP_SPECIFIER_ID 0x00005E
#define ETHER1394_GASP_SPECIFIER_ID_HI ((ETHER1394_GASP_SPECIFIER_ID >> 8) & 0xffff)
Expand Down
Loading

0 comments on commit 34641a5

Please sign in to comment.