Commit 546513f9 authored by Stefan Richter's avatar Stefan Richter Committed by Jody McIntyre

ieee1394: hpsb_send_phy_config() cleanup

Eliminate some code in hpsb_send_phy_config() which is provided
by hpsb_make_phypacket().
Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: default avatarJody McIntyre <scjody@modernduck.com>
parent d7758461
...@@ -463,6 +463,7 @@ void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet, ...@@ -463,6 +463,7 @@ void hpsb_packet_sent(struct hpsb_host *host, struct hpsb_packet *packet,
int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt) int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt)
{ {
struct hpsb_packet *packet; struct hpsb_packet *packet;
quadlet_t d = 0;
int retval = 0; int retval = 0;
if (rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 || if (rootid >= ALL_NODES || rootid < -1 || gapcnt > 0x3f || gapcnt < -1 ||
...@@ -472,26 +473,16 @@ int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt) ...@@ -472,26 +473,16 @@ int hpsb_send_phy_config(struct hpsb_host *host, int rootid, int gapcnt)
return -EINVAL; return -EINVAL;
} }
packet = hpsb_alloc_packet(0);
if (!packet)
return -ENOMEM;
packet->host = host;
packet->header_size = 8;
packet->data_size = 0;
packet->expect_response = 0;
packet->no_waiter = 0;
packet->type = hpsb_raw;
packet->header[0] = 0;
if (rootid != -1) if (rootid != -1)
packet->header[0] |= rootid << 24 | 1 << 23; d |= PHYPACKET_PHYCONFIG_R | rootid << PHYPACKET_PORT_SHIFT;
if (gapcnt != -1) if (gapcnt != -1)
packet->header[0] |= gapcnt << 16 | 1 << 22; d |= PHYPACKET_PHYCONFIG_T | gapcnt << PHYPACKET_GAPCOUNT_SHIFT;
packet->header[1] = ~packet->header[0]; packet = hpsb_make_phypacket(host, d);
if (!packet)
return -ENOMEM;
packet->generation = get_hpsb_generation(host); packet->generation = get_hpsb_generation(host);
retval = hpsb_send_packet_and_wait(packet); retval = hpsb_send_packet_and_wait(packet);
hpsb_free_packet(packet); hpsb_free_packet(packet);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment