Skip to content

Commit dadfab4

Browse files
committed
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
Pull IEEE 1394 (FireWire) subsystem updates from Stefan Richter: - IPv4-over-1394: fixes for broadcast and multicast - SBP-2: allow thin-provisioning related commands - trivia * tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: net: remove unused variable in fwnet_receive_broadcast() firewire: net: Fix handling of fragmented multicast/broadcast packets. firewire: sbp2: allow WRITE SAME and REPORT SUPPORTED OPERATION CODES tools/firewire: nosy-dump: check for allocation failure
2 parents 046e7d6 + db2cad2 commit dadfab4

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

‎drivers/firewire/net.c‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,6 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
828828
{
829829
struct fwnet_device *dev;
830830
struct fw_iso_packet packet;
831-
struct fw_card *card;
832831
__be16 *hdr_ptr;
833832
__be32 *buf_ptr;
834833
int retval;
@@ -840,7 +839,6 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
840839
unsigned long flags;
841840

842841
dev = data;
843-
card = dev->card;
844842
hdr_ptr = header;
845843
length = be16_to_cpup(hdr_ptr);
846844

@@ -861,8 +859,8 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context,
861859
if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) {
862860
buf_ptr += 2;
863861
length -= IEEE1394_GASP_HDR_SIZE;
864-
fwnet_incoming_packet(dev, buf_ptr, length,
865-
source_node_id, -1, true);
862+
fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
863+
context->card->generation, true);
866864
}
867865

868866
packet.payload_length = dev->rcv_buffer_size;
@@ -958,7 +956,12 @@ static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask)
958956
break;
959957
}
960958

961-
skb_pull(skb, ptask->max_payload);
959+
if (ptask->dest_node == IEEE1394_ALL_NODES) {
960+
skb_pull(skb,
961+
ptask->max_payload + IEEE1394_GASP_HDR_SIZE);
962+
} else {
963+
skb_pull(skb, ptask->max_payload);
964+
}
962965
if (ptask->outstanding_pkts > 1) {
963966
fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG,
964967
dg_size, fg_off, datagram_label);
@@ -1062,7 +1065,7 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask)
10621065
smp_rmb();
10631066
node_id = dev->card->node_id;
10641067

1065-
p = skb_push(ptask->skb, 8);
1068+
p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE);
10661069
put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);
10671070
put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24
10681071
| RFC2734_SW_VERSION, &p[4]);

‎drivers/firewire/sbp2.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,8 +1546,6 @@ static int sbp2_scsi_slave_configure(struct scsi_device *sdev)
15461546
struct sbp2_logical_unit *lu = sdev->hostdata;
15471547

15481548
sdev->use_10_for_rw = 1;
1549-
sdev->no_report_opcodes = 1;
1550-
sdev->no_write_same = 1;
15511549

15521550
if (sbp2_param_exclusive_login)
15531551
sdev->manage_start_stop = 1;

‎tools/firewire/nosy-dump.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ subaction_create(uint32_t *data, size_t length)
150150

151151
/* we put the ack in the subaction struct for easy access. */
152152
sa = malloc(sizeof *sa - sizeof sa->packet + length);
153+
if (!sa)
154+
exit(EXIT_FAILURE);
153155
sa->ack = data[length / 4 - 1];
154156
sa->length = length;
155157
memcpy(&sa->packet, data, length);
@@ -180,6 +182,8 @@ link_transaction_lookup(int request_node, int response_node, int tlabel)
180182
}
181183

182184
t = malloc(sizeof *t);
185+
if (!t)
186+
exit(EXIT_FAILURE);
183187
t->request_node = request_node;
184188
t->response_node = response_node;
185189
t->tlabel = tlabel;

0 commit comments

Comments
 (0)