Correct comments in genrtc.c to refer to correct /proc file.
[powerpc.git] / drivers / scsi / iscsi_tcp.c
index d0b139c..c9a3abf 100644 (file)
@@ -527,12 +527,12 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn)
                 * than 8K, but there are no targets that currently do this.
                 * For now we fail until we find a vendor that needs it
                 */
-               if (DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH <
+               if (ISCSI_DEF_MAX_RECV_SEG_LEN <
                    tcp_conn->in.datalen) {
                        printk(KERN_ERR "iscsi_tcp: received buffer of len %u "
                              "but conn buffer is only %u (opcode %0x)\n",
                              tcp_conn->in.datalen,
-                             DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, opcode);
+                             ISCSI_DEF_MAX_RECV_SEG_LEN, opcode);
                        rc = ISCSI_ERR_PROTO;
                        break;
                }
@@ -749,7 +749,7 @@ static int iscsi_scsi_data_in(struct iscsi_conn *conn)
                                if (!offset)
                                        crypto_hash_update(
                                                        &tcp_conn->rx_hash,
-                                                       &sg[i], 1);
+                                                       &sg[i], sg[i].length);
                                else
                                        partial_sg_digest_update(
                                                        &tcp_conn->rx_hash,
@@ -1375,7 +1375,7 @@ iscsi_tcp_mtask_xmit(struct iscsi_conn *conn, struct iscsi_mgmt_task *mtask)
        }
 
        BUG_ON(tcp_mtask->xmstate != XMSTATE_IDLE);
-       if (mtask->hdr->itt == cpu_to_be32(ISCSI_RESERVED_TAG)) {
+       if (mtask->hdr->itt == RESERVED_ITT) {
                struct iscsi_session *session = conn->session;
 
                spin_lock_bh(&session->lock);
@@ -1762,7 +1762,7 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
         * due to strange issues with iser these are not set
         * in iscsi_conn_setup
         */
-       conn->max_recv_dlength = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
+       conn->max_recv_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN;
 
        tcp_conn = kzalloc(sizeof(*tcp_conn), GFP_KERNEL);
        if (!tcp_conn)
@@ -1777,14 +1777,24 @@ iscsi_tcp_conn_create(struct iscsi_cls_session *cls_session, uint32_t conn_idx)
        tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0,
                                                  CRYPTO_ALG_ASYNC);
        tcp_conn->tx_hash.flags = 0;
-       if (!tcp_conn->tx_hash.tfm)
+       if (IS_ERR(tcp_conn->tx_hash.tfm)) {
+               printk(KERN_ERR "Could not create connection due to crc32c "
+                      "loading error %ld. Make sure the crc32c module is "
+                      "built as a module or into the kernel\n",
+                       PTR_ERR(tcp_conn->tx_hash.tfm));
                goto free_tcp_conn;
+       }
 
        tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
                                                  CRYPTO_ALG_ASYNC);
        tcp_conn->rx_hash.flags = 0;
-       if (!tcp_conn->rx_hash.tfm)
+       if (IS_ERR(tcp_conn->rx_hash.tfm)) {
+               printk(KERN_ERR "Could not create connection due to crc32c "
+                      "loading error %ld. Make sure the crc32c module is "
+                      "built as a module or into the kernel\n",
+                       PTR_ERR(tcp_conn->rx_hash.tfm));
                goto free_tx_tfm;
+       }
 
        return cls_conn;
 
@@ -2044,13 +2054,11 @@ iscsi_tcp_conn_get_param(struct iscsi_cls_conn *cls_conn,
                sk = tcp_conn->sock->sk;
                if (sk->sk_family == PF_INET) {
                        inet = inet_sk(sk);
-                       len = sprintf(buf, "%u.%u.%u.%u\n",
+                       len = sprintf(buf, NIPQUAD_FMT "\n",
                                      NIPQUAD(inet->daddr));
                } else {
                        np = inet6_sk(sk);
-                       len = sprintf(buf,
-                               "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-                               NIP6(np->daddr));
+                       len = sprintf(buf, NIP6_FMT "\n", NIP6(np->daddr));
                }
                mutex_unlock(&conn->xmitmutex);
                break;
@@ -2140,6 +2148,7 @@ static struct scsi_host_template iscsi_sht = {
        .change_queue_depth     = iscsi_change_queue_depth,
        .can_queue              = ISCSI_XMIT_CMDS_MAX - 1,
        .sg_tablesize           = ISCSI_SG_TABLESIZE,
+       .max_sectors            = 0xFFFF,
        .cmd_per_lun            = ISCSI_DEF_CMD_PER_LUN,
        .eh_abort_handler       = iscsi_eh_abort,
        .eh_host_reset_handler  = iscsi_eh_host_reset,