···4747 tristate "IP networking over 1394"4848 depends on FIREWIRE && INET4949 help5050- This enables IPv4 over IEEE 1394, providing IP connectivity with5151- other implementations of RFC 2734 as found on several operating5252- systems. Multicast support is currently limited.5050+ This enables IPv4/IPv6 over IEEE 1394, providing IP connectivity5151+ with other implementations of RFC 2734/3146 as found on several5252+ operating systems. Multicast support is currently limited.53535454 To compile this driver as a module, say M here: The module will be5555 called firewire-net.
+74-5
drivers/firewire/net.c
···11/*22 * IPv4 over IEEE 1394, per RFC 273433+ * IPv6 over IEEE 1394, per RFC 314634 *45 * Copyright (C) 2009 Jay Fenlason <fenlason@redhat.com>56 *···47464847#define IANA_SPECIFIER_ID 0x00005eU4948#define RFC2734_SW_VERSION 0x000001U4949+#define RFC3146_SW_VERSION 0x000002U50505151#define IEEE1394_GASP_HDR_SIZE 85252···507505 switch (ether_type) {508506 case ETH_P_ARP:509507 case ETH_P_IP:508508+#if IS_ENABLED(CONFIG_IPV6)509509+ case ETH_P_IPV6:510510+#endif510511 break;511512 default:512513 goto err;···773768 ver = be32_to_cpu(buf_ptr[1]) & 0xffffff;774769 source_node_id = be32_to_cpu(buf_ptr[0]) >> 16;775770776776- if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) {771771+ if (specifier_id == IANA_SPECIFIER_ID &&772772+ (ver == RFC2734_SW_VERSION773773+#if IS_ENABLED(CONFIG_IPV6)774774+ || ver == RFC3146_SW_VERSION775775+#endif776776+ )) {777777 buf_ptr += 2;778778 length -= IEEE1394_GASP_HDR_SIZE;779779 fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,···981971 u8 *p;982972 int generation;983973 int node_id;974974+ unsigned int sw_version;984975985976 /* ptask->generation may not have been set yet */986977 generation = dev->card->generation;987978 smp_rmb();988979 node_id = dev->card->node_id;989980981981+ switch (ptask->skb->protocol) {982982+ default:983983+ sw_version = RFC2734_SW_VERSION;984984+ break;985985+#if IS_ENABLED(CONFIG_IPV6)986986+ case htons(ETH_P_IPV6):987987+ sw_version = RFC3146_SW_VERSION;988988+#endif989989+ }990990+990991 p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE);991992 put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);992993 put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24993993- | RFC2734_SW_VERSION, &p[4]);994994+ | sw_version, &p[4]);994995995996 /* We should not transmit if broadcast_channel.valid == 0. */996997 fw_send_request(dev->card, &ptask->transaction,···12691248 switch (proto) {12701249 case htons(ETH_P_ARP):12711250 case htons(ETH_P_IP):12511251+#if IS_ENABLED(CONFIG_IPV6)12521252+ case htons(ETH_P_IPV6):12531253+#endif12721254 break;12731255 default:12741256 goto fail;···15141490 goto out;1515149115161492 list_add_tail(&dev->dev_link, &fwnet_device_list);15171517- dev_notice(&net->dev, "IPv4 over IEEE 1394 on card %s\n",14931493+ dev_notice(&net->dev, "IP over IEEE 1394 on card %s\n",15181494 dev_name(card->device));15191495 have_dev:15201496 ret = fwnet_add_peer(dev, unit, device);···16031579 .specifier_id = IANA_SPECIFIER_ID,16041580 .version = RFC2734_SW_VERSION,16051581 },15821582+#if IS_ENABLED(CONFIG_IPV6)15831583+ {15841584+ .match_flags = IEEE1394_MATCH_SPECIFIER_ID |15851585+ IEEE1394_MATCH_VERSION,15861586+ .specifier_id = IANA_SPECIFIER_ID,15871587+ .version = RFC3146_SW_VERSION,15881588+ },15891589+#endif16061590 { }16071591};16081592···16481616 .data = rfc2374_unit_directory_data16491617};1650161816191619+#if IS_ENABLED(CONFIG_IPV6)16201620+static const u32 rfc3146_unit_directory_data[] = {16211621+ 0x00040000, /* directory_length */16221622+ 0x1200005e, /* unit_specifier_id: IANA */16231623+ 0x81000003, /* textual descriptor offset */16241624+ 0x13000002, /* unit_sw_version: RFC 3146 */16251625+ 0x81000005, /* textual descriptor offset */16261626+ 0x00030000, /* descriptor_length */16271627+ 0x00000000, /* text */16281628+ 0x00000000, /* minimal ASCII, en */16291629+ 0x49414e41, /* I A N A */16301630+ 0x00030000, /* descriptor_length */16311631+ 0x00000000, /* text */16321632+ 0x00000000, /* minimal ASCII, en */16331633+ 0x49507636, /* I P v 6 */16341634+};16351635+16361636+static struct fw_descriptor rfc3146_unit_directory = {16371637+ .length = ARRAY_SIZE(rfc3146_unit_directory_data),16381638+ .key = (CSR_DIRECTORY | CSR_UNIT) << 24,16391639+ .data = rfc3146_unit_directory_data16401640+};16411641+#endif16421642+16511643static int __init fwnet_init(void)16521644{16531645 int err;···16801624 if (err)16811625 return err;1682162616271627+#if IS_ENABLED(CONFIG_IPV6)16281628+ err = fw_core_add_descriptor(&rfc3146_unit_directory);16291629+ if (err)16301630+ goto out;16311631+#endif16321632+16831633 fwnet_packet_task_cache = kmem_cache_create("packet_task",16841634 sizeof(struct fwnet_packet_task), 0, 0, NULL);16851635 if (!fwnet_packet_task_cache) {16861636 err = -ENOMEM;16871687- goto out;16371637+ goto out2;16881638 }1689163916901640 err = driver_register(&fwnet_driver.driver);···16981636 return 0;1699163717001638 kmem_cache_destroy(fwnet_packet_task_cache);16391639+out2:16401640+#if IS_ENABLED(CONFIG_IPV6)16411641+ fw_core_remove_descriptor(&rfc3146_unit_directory);17011642out:16431643+#endif17021644 fw_core_remove_descriptor(&rfc2374_unit_directory);1703164517041646 return err;···17131647{17141648 driver_unregister(&fwnet_driver.driver);17151649 kmem_cache_destroy(fwnet_packet_task_cache);16501650+#if IS_ENABLED(CONFIG_IPV6)16511651+ fw_core_remove_descriptor(&rfc3146_unit_directory);16521652+#endif17161653 fw_core_remove_descriptor(&rfc2374_unit_directory);17171654}17181655module_exit(fwnet_cleanup);1719165617201657MODULE_AUTHOR("Jay Fenlason <fenlason@redhat.com>");17211721-MODULE_DESCRIPTION("IPv4 over IEEE1394 as per RFC 2734");16581658+MODULE_DESCRIPTION("IP over IEEE1394 as per RFC 2734/3146");17221659MODULE_LICENSE("GPL");17231660MODULE_DEVICE_TABLE(ieee1394, fwnet_id_table);
+19-1
net/ipv6/addrconf.c
···7070#include <net/snmp.h>71717272#include <net/af_ieee802154.h>7373+#include <net/firewire.h>7374#include <net/ipv6.h>7475#include <net/protocol.h>7576#include <net/ndisc.h>···17391738 return 0;17401739}1741174017411741+static int addrconf_ifid_ieee1394(u8 *eui, struct net_device *dev)17421742+{17431743+ union fwnet_hwaddr *ha;17441744+17451745+ if (dev->addr_len != FWNET_ALEN)17461746+ return -1;17471747+17481748+ ha = (union fwnet_hwaddr *)dev->dev_addr;17491749+17501750+ memcpy(eui, &ha->uc.uniq_id, sizeof(ha->uc.uniq_id));17511751+ eui[0] ^= 2;17521752+ return 0;17531753+}17541754+17421755static int addrconf_ifid_arcnet(u8 *eui, struct net_device *dev)17431756{17441757 /* XXX: inherit EUI-64 from other interface -- yoshfuji */···18171802 return addrconf_ifid_gre(eui, dev);18181803 case ARPHRD_IEEE802154:18191804 return addrconf_ifid_eui64(eui, dev);18051805+ case ARPHRD_IEEE1394:18061806+ return addrconf_ifid_ieee1394(eui, dev);18201807 }18211808 return -1;18221809}···26602643 (dev->type != ARPHRD_FDDI) &&26612644 (dev->type != ARPHRD_ARCNET) &&26622645 (dev->type != ARPHRD_INFINIBAND) &&26632663- (dev->type != ARPHRD_IEEE802154)) {26462646+ (dev->type != ARPHRD_IEEE802154) &&26472647+ (dev->type != ARPHRD_IEEE1394)) {26642648 /* Alas, we support only Ethernet autoconfiguration. */26652649 return;26662650 }