Skip to content
Snippets Groups Projects
Select Git revision
  • 3f99306337ba1871afc8568e8b36004ce3cee039
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

iscsi_target_parameters.c

Blame
  • iscsi_target_parameters.c 51.97 KiB
    /*******************************************************************************
     * This file contains main functions related to iSCSI Parameter negotiation.
     *
     * \u00a9 Copyright 2007-2011 RisingTide Systems LLC.
     *
     * Licensed to the Linux Foundation under the General Public License (GPL) version 2.
     *
     * Author: Nicholas A. Bellinger <nab@linux-iscsi.org>
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or
     * (at your option) any later version.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     ******************************************************************************/
    
    #include <linux/slab.h>
    
    #include "iscsi_target_core.h"
    #include "iscsi_target_util.h"
    #include "iscsi_target_parameters.h"
    
    int iscsi_login_rx_data(
    	struct iscsi_conn *conn,
    	char *buf,
    	int length)
    {
    	int rx_got;
    	struct kvec iov;
    
    	memset(&iov, 0, sizeof(struct kvec));
    	iov.iov_len	= length;
    	iov.iov_base	= buf;
    
    	/*
    	 * Initial Marker-less Interval.
    	 * Add the values regardless of IFMarker/OFMarker, considering
    	 * it may not be negoitated yet.
    	 */
    	conn->of_marker += length;
    
    	rx_got = rx_data(conn, &iov, 1, length);
    	if (rx_got != length) {
    		pr_err("rx_data returned %d, expecting %d.\n",
    				rx_got, length);
    		return -1;
    	}
    
    	return 0 ;
    }
    
    int iscsi_login_tx_data(
    	struct iscsi_conn *conn,
    	char *pdu_buf,
    	char *text_buf,
    	int text_length)
    {
    	int length, tx_sent;
    	struct kvec iov[2];
    
    	length = (ISCSI_HDR_LEN + text_length);
    
    	memset(&iov[0], 0, 2 * sizeof(struct kvec));
    	iov[0].iov_len		= ISCSI_HDR_LEN;
    	iov[0].iov_base		= pdu_buf;
    	iov[1].iov_len		= text_length;